Changes between Version 51 and Version 52 of SOPs/miningSAMBAM


Ignore:
Timestamp:
08/08/24 11:50:35 (5 months ago)
Author:
gbell
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SOPs/miningSAMBAM

    v51 v52  
    4444/nfs/BaRC_Public/BaRC_code/Perl/SAM_to_BAM_sort_index/SAM_to_BAM_sort_index.pl
    4545# Or on a folder of SAM files
    46 for samFile in `/bin/ls *.sam`; do bsub /nfs/BaRC_Public/BaRC_code/Perl/SAM_to_BAM_sort_index/SAM_to_BAM_sort_index.pl $samFile ; done
     46for samFile in `/bin/ls *.sam`; do sbatch --partition=20 --job-name=sam2bam --mem=32G --wrap "/nfs/BaRC_Public/BaRC_code/Perl/SAM_to_BAM_sort_index/SAM_to_BAM_sort_index.pl $samFile " ; done
    4747}}}
    4848
     
    167167Tophat/bowtie mappers create the tag NH:i:XXX where XXX is the number of times the read has mapped.
    168168{{{
    169 bsub "samtools view accepted_hits.bam | grep -v NH:i:1 | perl -pe 's/AS.+(NH:i:\d+)/\$1/' | cut -f1,10,12 | perl -pe 's/NH:i://' | sort -u -k3,3nr > Multi-mapped.sorted.txt"
     169sbatch --partition=20 --job-name=samtools --mem=32G --wrap "samtools view accepted_hits.bam | grep -v NH:i:1 | perl -pe 's/AS.+(NH:i:\d+)/\$1/' | cut -f1,10,12 | perl -pe 's/NH:i://' | sort -u -k3,3nr > Multi-mapped.sorted.txt"
    170170# Output format:
    171171# read_ID<tab>read<tab>number times mapped
     
    186186#               accepted_hits_posStrand.bam: mapped to positive strand
    187187
    188 bsub "samtools view -f 16 -b accepted_hits.bam >| accepted_hits_negStrand.bam"
    189 bsub "samtools view -F 16 -b accepted_hits.bam >| accepted_hits_posStrand.bam"
     188sbatch --partition=20 --job-name=samtools --mem=32G --wrap "samtools view -f 16 -b accepted_hits.bam >| accepted_hits_negStrand.bam"
     189sbatch --partition=20 --job-name=samtools --mem=32G --wrap "samtools view -F 16 -b accepted_hits.bam >| accepted_hits_posStrand.bam"
    190190
    191191}}}
     
    196196# output:       1st pair: accepted_hits_1stPair.bam
    197197#               2nd pair: accepted_hits_2ndPair.bam
    198 bsub "samtools view -b -f 0x0040 accepted_hits.bam > accepted_hits_1stPair.bam"
    199 bsub "samtools view -b -F 0x0040 accepted_hits.bam > accepted_hits_2ndPair.bam"
     198sbatch --partition=20 --job-name=samtools --mem=32G --wrap "samtools view -b -f 0x0040 accepted_hits.bam > accepted_hits_1stPair.bam"
     199sbatch --partition=20 --job-name=samtools --mem=32G --wrap "samtools view -b -F 0x0040 accepted_hits.bam > accepted_hits_2ndPair.bam"
    200200}}}
    201201
     
    243243qualimap bamqc -bam Mapped_DNA_reads.bam -outdir qualimap_output -outformat PDF:HTML
    244244# Command-line execution may require disabling X-windows
    245 bsub "unset DISPLAY; qualimap bamqc -bam Mapped_DNA_reads.bam -outdir qualimap_output -outformat PDF:HTML"
     245sbatch --partition=20 --job-name=bamqc --mem=32G --wrap "unset DISPLAY; qualimap bamqc -bam Mapped_DNA_reads.bam -outdir qualimap_output -outformat PDF:HTML"
    246246}}}
    247247