Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to detect all scaffolds (instead of chromosomes) in a bam file #132

Open
BrunaLuz opened this issue Jul 16, 2024 · 1 comment
Open
Labels
documentation Improvements or additions to documentation

Comments

@BrunaLuz
Copy link

I am working with a non-model organism whose genome was constructed at the scaffold level. How can I automatically name all scaffolds from my bam file using the command --chrom? Thank you!

@hxj5
Copy link
Collaborator

hxj5 commented Jul 16, 2024

Hi, the --chrom option is used for pileup reads from BAM files by matching the input "chrom" names with the RNAME field (the third column) of each BAM (alignment) record. It should work in your case if the "scaffold" names are stored in the RNAME field of BAM records and also specified in --chrom option.

For now --chrom option can not automatically extract all chrom/scaffold names from BAM files. These names have to be manually specified, which should be straightforward, e.g., if your BAM file has been indexed (i.e., ".bai" file exists), then the list of chrom/scaffold names can be obtained with samtools idxstats <BAM file> | cut -f1 | tr '\n' ',' (need further check).

@hxj5 hxj5 added the documentation Improvements or additions to documentation label Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants