Making slices from BAM files: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
<source lang='bash'> | <source lang='bash'> | ||
BAMFILE=`ls *.bam | sed 's/.bam//'` | BAMFILE=`ls $BAMDIR*.bam | sed 's/.\+\///' | sed 's/.bam//'` | ||
</source> | </source> | ||
Revision as of 11:47, 7 March 2012
create a variable with all your bamfile names
<source lang='bash'> BAMFILE=`ls $BAMDIR*.bam | sed 's/.\+\///' | sed 's/.bam//'` </source>
check that your variable contains valid information
<source lang='bash'> echo $BAMFILE </source>
make a slice for each bamfile
<source lang='bash'> 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 </source>