Changeset 5835


Ignore:
Timestamp:
Feb 24, 2020, 1:37:16 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1218: Implement MIPs alignment

Re-designed the two steps that convert FASTQ files to BAM and annotate them with UMI information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/grid/MipsAlignJobCreator.java

    r5833 r5835  
    340340      script.cmd("   run_trimmomatic \"${prefix}\" $n");
    341341      script.cmd("done");
     342      script.newLine();
    342343      script.cmd("trimlog_stats \"tmp/*.adaptrim.log\" \"out/adaptrim.hist.txt\"");
    343344      script.cmd("trimlog_stats \"tmp/*.qualtrim.log\" \"out/qualtrim.hist.txt\"");
     345      script.newLine();
    344346      script.cmd("if [ ${nAfterTrim} -eq 0 ]; then");
    345347      script.cmd("  echo \"No paired end reads surviving adapter and quality trimming for any fastq prefix\" 1>&2");
    346348      script.cmd("exit 1");
    347349      script.cmd("fi");
    348      
     350      script.newLine();
     351     
     352      script.comment("Run Picard FastqToSam and annotate the BAM files with UMI");
     353      script.progress(30, "Converting FASTQ to BAM and annotating with UMI");
     354      script.cmd("n=0");
     355      script.cmd("for prefix in ${FastqPrefix[@]} ; do");
     356      script.cmd("   n=$((n + 1))");
     357      script.cmd("   fastq_to_bam \"${prefix}\" $n");
     358      script.cmd("   annotate_umi \"${prefix}\" $n");
     359      script.cmd("done");
     360      script.newLine();
     361
    349362      /*
    350       script.comment("Run Picard FastqToSam and annotat the BAM files with UMI");
    351       script.cmd("for prefix in ${FastqPrefix[@]} ; do");
    352       // Picard2 uses different parameter syntax, but the .rg file is stored in picard1 syntax
    353       script.cmd("   rg_info=`./convert_picard_parameters.sh < fastq/${prefix}.rg`");
    354 
    355       String toBamCmd = "./stdwrap.sh ./picard2 FastqToSam";
    356       toBamCmd += " -SORT_ORDER queryname";
    357       toBamCmd += " -QUALITY_FORMAT Standard";
    358       toBamCmd += " ${rg_info}";
    359       toBamCmd += " -FASTQ trim.quality/${prefix}_R1.fastq";
    360       toBamCmd += " -FASTQ2 trim.quality/${prefix}_R2.fastq";
    361       toBamCmd += " -OUTPUT bam/${prefix}.bam";
    362       toBamCmd += " >> fastqtosam.out";
    363      
    364       String umiCmd = "./stdwrap.sh ${JAVA} -jar ${FgBioJAR} AnnotateBamWithUmis";
    365       umiCmd += " --fail-fast true -t RX";
    366       umiCmd += " -i bam/${prefix}.bam";
    367       umiCmd += " -f fastq/${prefix}_UMI.fastq.gz";
    368       umiCmd += " -o bam.umi/${prefix}.bam";
    369       umiCmd += " >> annotatebam.out";
    370      
    371       script.cmd("   " + toBamCmd);
    372       script.cmd("   " + umiCmd);
    373       script.cmd("done");
    374       script.newLine();
    375    
    376363      script.cmd("min_insert=$(awk 'NR == 1 || $3 - $2 < min {min = $3 - $2}END{print min - 1}' \"${AmpliconsBed}\")");
    377364      script.cmd("max_insert=$(awk 'NR == 1 || $3 - $2 > max {max = $3 - $2}END{print max + 1}' \"${AmpliconsBed}\")");
Note: See TracChangeset for help on using the changeset viewer.