I'm using the software plink2 (https://www.cog-genomics.org/plink/2.0/) and I'm trying to iterate over 3 variables.
This software admits an input file with .ped extention file and an exclude file with .txt extention which contains a list of names to be excluded from the input file.
The idea is to iterate over the input files and then over exclude files to generate single outputfiles.
- Input files: Highland.ped - Midland.ped - Lowland.ped
- Exclude-map files: HighlandMidland.txt - HighlandLowland.txt - MidlandLowland.txt
- Output files: HighlandMidland - HighlandLowland - MidlandHighland - MidlandLowland - LowlandHighland - LowlandMidland
The general code is:
plink2 --file Highland --exclude HighlandMidland.txt --out HighlandMidland
plink2 --file Highland --exclude HighlandLowland.txt --out HighlandLowland
plink2 --file Midland --exclude HighlandMidland.txt --out MidlandHighland
plink2 --file Midland --exclude MidlandLowland.txt --out MidlandLowland
plink2 --file Lowland --exclude HighlandLowland.txt --out LowlandHighland
plink2 --file Lowland --exclude MidlandLowland.txt --out LowlandMidland
To avoid repeating this code 6 different times I would like to use the variables listed above (1, 2 and 3) to create single output files. Outputfiles are a permutation with replacements of the inputfile names.