Skip to content

Conversation

@gmafrafortuna
Copy link
Collaborator

so it starts from the file with the most samples

import os

for file in input:
shell("wc -l {file} >> files_len.txt")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sorts by the number of lines - which is SNPs, not samples. Is this ok?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is about the number of individuals, correct @gmafrafortuna ? We could probably extract the number of individuals using vcf/bcftools. I also found this awk one-liner: awk '{if ($1 == "#CHROM"){print NF-9; exit}}' input_vcf_file.vcf This looks at the #CHROM line in the vcf file which is the line of the column header (which includes individual names).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants