I have some bam files and would like to use them for further analysis. but I want to do more analysis only on some of the genes not everything in the bam file. I have a list of genes that I want to use for the next step. also in my list I have both gene symbol and gene ids like:
AAAS ENSG00000094914
ACO2 ENSG00000100412
I thought samtools can help to get such a bam file (like the following command), but I don't know what should be included instead of ? marks or if that is possible.
samtools view -h in.bam | ?????? > out.bam
actually I searched for that but did not find anything useful. do you know how I can get a new bam file only for the genes in my list?
should be :
nice catch, I edited, thank you !