Changeset 5828


Ignore:
Timestamp:
Feb 19, 2020, 2:02:00 PM (3 years ago)
Author:
Nicklas Nordborg
Message:

References #1218: Implement MIPs alignment

Added FastqToSam? step that convertes paired FASTQ files to BAM format.

File:
1 edited

Legend:

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

    r5827 r5828  
    142142      trimmomatic_path = cfg.getRequiredConfig("programs/trimmomatic/path", alignParameterSet);
    143143    }
     144    String picard_path = cfg.getRequiredConfig("programs/picard/path", alignParameterSet);
    144145
    145146    // Options for the programs
     
    254255      script.comment("Setting up scripting environment and copying script to tmp folder");
    255256      script.cmd("ScriptDir=" + pipeline_scripts_path);
     257      script.cmd("PicardDir="+picard_path);
    256258      script.cmd("JAVA="+java_path);
    257259      script.cmd("TrimmomaticJAR="+trimmomatic_path);
     
    278280      script.cmd("mkdir trimmomatic.1");
    279281      script.cmd("mkdir trimmomatic.2");
     282      script.cmd("mkdir bam.1");
    280283      script.cmd("cp ${ScriptDir}/stdwrap.sh .");
    281284      script.cmd("cp ${ScriptDir}/mips_adapters.sh .");
     285      script.cmd("cp ${ScriptDir}/picard2 .");
     286      script.cmd("cp ${ScriptDir}/convert_picard_parameters.sh .");
    282287      script.newLine();
    283288
     
    286291      script.newLine();
    287292     
    288       script.comment("Copy FASTQ files to tmp folder");
     293      script.comment("Copy FASTQ and .rg files to tmp folder");
    289294      script.progress(10, "Copying FASTQ files");
    290295      script.cmd("if [ ! -d \"${FastqFolder}\" ]; then");
     
    293298      script.cmd("fi");
    294299      script.cmd("cp ${FastqFolder}/*.fastq.gz fastq");
     300      script.cmd("cp ${FastqFolder}/*.rg fastq");
    295301      script.newLine();
    296302
     
    328334      trimCmd2 += " >> trimmomatic.2/trimmomatic.out";
    329335      script.cmd("   " + trimCmd1);
    330       script.cmd("   " + trimCmd2);   
     336      script.cmd("   " + trimCmd2);
    331337      script.cmd("done");
    332338     
     339      script.comment("Run Picard FastqToSam");
     340      script.cmd("for prefix in ${FastqPrefix[@]} ; do");
     341      // Picard2 uses different parameter syntax, but the .rg file is stored in picard1 syntax
     342      script.cmd("   rg_info=`./convert_picard_parameters.sh < fastq/${prefix}.rg`");
     343
     344      String toSamCmd = "./stdwrap.sh ./picard2 FastqToSam";
     345      toSamCmd += " -SORT_ORDER queryname";
     346      toSamCmd += " -QUALITY_FORMAT Standard";
     347      toSamCmd += " ${rg_info}";
     348      toSamCmd += " -FASTQ trimmomatic.2/${prefix}_R1.fastq";
     349      toSamCmd += " -FASTQ2 trimmomatic.2/${prefix}_R2.fastq";
     350      toSamCmd += " -OUTPUT bam.1/${prefix}.bam";
     351      toSamCmd += " >> fastqtosam.out";
     352      script.cmd("   " + toSamCmd);
     353      script.cmd("done");
    333354      /*
    334355      script.progress(95, "Copying result files to project archive");
Note: See TracChangeset for help on using the changeset viewer.