Changeset 5837


Ignore:
Timestamp:
Feb 24, 2020, 3:40:08 PM (22 months ago)
Author:
Nicklas Nordborg
Message:

References #1218: Implement MIPs alignment

Re-designed the alignment and merge step.

File:
1 edited

Legend:

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

    r5835 r5837  
    296296      script.cmd("TrimOptionsAdapter=\""+align_trimmomaticOptions1+"\"");
    297297      script.cmd("TrimOptionsQual=\""+align_trimmomaticOptions2+"\"");
     298      script.cmd("NovoAlignOptions=\""+novoalign_options+"\"");
    298299     
    299300      script.newLine();
     
    360361      script.newLine();
    361362
    362       /*
     363      script.comment("Run novoalign");
     364      script.progress(40, "Aligning with novoalign");
    363365      script.cmd("min_insert=$(awk 'NR == 1 || $3 - $2 < min {min = $3 - $2}END{print min - 1}' \"${AmpliconsBed}\")");
    364366      script.cmd("max_insert=$(awk 'NR == 1 || $3 - $2 > max {max = $3 - $2}END{print max + 1}' \"${AmpliconsBed}\")");
    365       script.comment("Run novoalign");
     367      script.cmd("n=0");
    366368      script.cmd("AlignedBams=''");
    367369      script.cmd("for prefix in ${FastqPrefix[@]} ; do");
    368      
    369       String alignCmd = "./stderrwrap.sh ${NovoAlign}";
    370       alignCmd += " -c ${NumThreads}";
    371       alignCmd += " " + novoalign_options;
    372       alignCmd += " -d ${NovoIndex} --tags MC,ZP -i PE ${min_insert}-${max_insert}";
    373       alignCmd += " --amplicons ${AmpliconsBed}";
    374       alignCmd += " 1 bam.aligned/${prefix}.novo_coverage.bed";
    375       alignCmd += " -f bam.umi/${prefix}.bam";
    376       alignCmd += " > bam.aligned/${prefix}.bam";
    377       alignCmd += " 3> bam.aligned/${prefix}.novo.log";
    378      
    379       String sortCmd = "./stderrwrap.sh ${NovoSort}";
    380       sortCmd += " -c ${NumThreads} -t . -i";
    381       sortCmd += " -o bam.sorted/${prefix}.bam";
    382       sortCmd += " bam.aligned/${prefix}.bam";
    383       sortCmd += " 3> bam.sorted/${prefix}.novo.log";
    384      
    385       script.cmd("   " + alignCmd);
    386       script.cmd("   " + sortCmd);
    387       script.cmd("   AlignedBams=\"${AlignedBams} -INPUT bam.sorted/${prefix}.bam\"");
     370      script.cmd("   n=$((n + 1))");
     371      script.cmd("   novoalign \"${prefix}\" $n");
    388372      script.cmd("done");
    389373      script.newLine();
    390      
    391374      script.comment("Merge BAM files");
    392       String mergeCmd = "./stdwrap.sh ./picard2 MergeSamFiles";
    393       mergeCmd += " -SORT_ORDER coordinate -ASSUME_SORTED true";
    394       mergeCmd += " ${AlignedBams}";
    395       mergeCmd += " -OUTPUT bam.merged/novo.bam";
    396       mergeCmd += " > mergesam.out";
    397       script.cmd(mergeCmd);
    398       script.newLine();
    399 
     375      script.cmd("merge_bam");
     376      script.newLine();
     377     
     378      /*
    400379      script.comment("Re-header BAM files");
    401380      script.cmd("${samtools} view -H bam.merged/novo.bam | grep -v \"^@SQ\" > header.sam");
Note: See TracChangeset for help on using the changeset viewer.