Making slices from BAM files

From HPCwiki
Revision as of 12:43, 7 March 2012 by Hjmegens (talk | contribs)
Jump to navigation Jump to search

create a variable with all your bamfile names

BAMFILE=`ls *.bam | sed 's/.bam//'`

check that your variable contains valid information

echo $BAMFILE

make a slice for each bamfile

for i in $BAMFILE; 
    do echo $i; 
    samtools view -b /shared/Sus/BAM_files_hjm_newbuild10_2/$i.bam Ssc10_2_8:43212683-43981653 >$i.SSC8_43212683-43981653.bam ; 
done