This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Subset analyze of multiple sample file in PLINK 1.9

Hello,

I want to do GWAS with PLINK. I already have a data containing all the samples and have done association analyze with plink command below.

plink --bfile All_SNP.binary --make-pheno phenotype.pheno "phenoA" --aec --assoc --reference-allele All_alt_alleles --allow-no-sex --adjust --noweb --out output &

However, there are four groups of samples and I want to analyze the GWAS in two of these groups which are different phenotypes.

Is there any way indicating plink which of the two to analyze ?

The sample's information looks like this:

sample1  phenoB    location1
sample2  phenoB    location1
sample3  phenoA   location1
sample4  phenoA   location1
sample5  phenoB    location2
sample6  phenoB    location2
sample7  phenoA   location2
sample8  phenoA   location2

I have analyzed the association between phenoA and SNP sites

however, I want to analyze the association between phenoA and SNP sites of samples only in location1 and location2 separately. Is --within argument in PLINK useful in such a situation?

Thanks for help

snp sequence plink

1 answer

Using input filters for samples: --keep or --remove

We can use grep to make mylist_location1.txt something like:

grep location1 myFile.txt > mylist_location1.txt

Then run plink with filter keep:

plink --file data --keep mylist_location1.txt

Thanks for your help

So, the command

plink --file data --keep mylist_location1.txt

means that PLINK generate the binary files with the list from my input data? the command may look like plink --file data --keep mylist_location1.txt --make-bed --out output.binary?

or means I can only use the list to generate an association analyze like

'plink --file data.binary --keep mylist_location1.txt --assoc --make-pheno phenotype.pheno "phenoB" --adjust --allow-no-sex --out output'

Besides that How about using

--within [filename] <keep-na> ?

I want to know how to use clusters of samples, but I don't quite understand the format of cluster file

I have tried the --keep mylist_location.txt in my command But it shows

Error: Line 1 of --keep file has fewer tokens than expected.

the format in mylist_location1.txt looks like

sample1
sample2
sample3
sample4

but it shows Error in the end

Log in to answer this question.