Entering edit mode
                    3.5 years ago
        tien
        
    
        ▴
    
    40
    Hello everyone,
Besides chr1->22, there are others name like chrM, KI270728.1,.... I want to create a bam file of these chromosome names (which is listed in common_chr.bed) by using samtools
samtools view -L common_chr.bed -U out_bam.bam in_bam.bam
I need to create common_chr.bed but not sure how to do this. Is there any way to create such bed file of distinct chromosome names and their positions from in_bam.bam that excludes chr1->22
Thanks for your help.
Thanks for your reply. I'm using output from cellranger and find no such fastq file for
faidx. The two files that I have is bam and its bam index file. I try to use the above command with bam index file but it does not work. Do you know any other methods?find the fasta reference file, index it with
samtools faidx /path/to/ref.fasta