Changeset 5768


Ignore:
Timestamp:
Dec 2, 2019, 2:22:53 PM (4 years ago)
Author:
Nicklas Nordborg
Message:

References #1208: Implement wizard for building database of variant frequencies in SCAN-B samples

Started to implement the script for calculating the variant statistics. Most of the work is done by the mut_stats.py python script. After that we need to sort and index the result. The final VCF file is currently left in the working directory which is obviously not a good place.

File:
1 edited

Legend:

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

    r5766 r5768  
    9191    }
    9292   
     93    String projectRoot = cfg.getRequiredConfig("project-archive", null);
     94    String pipeline_scripts_path = cfg.getRequiredConfig("programs/pipeline-scripts/path", null);
     95    String bedtools_path = cfg.getRequiredConfig("programs/bedtools/path", null);
     96
    9397    // Options for the job
    9498    JobConfig jobConfig = new JobConfig();
     
    110114    ScriptBuilder script = new ScriptBuilder();
    111115    script.comment("Setting up scripting environment and copying script to tmp folder");
     116    script.cmd("export ScriptDir=" + pipeline_scripts_path);
     117    script.newLine();
     118
     119    script.cmd("cd ${TMPDIR}");
     120    script.cmd("cp ${ScriptDir}/mut_stats.py .");
     121    script.newLine();
    112122   
    113     // TODO -- Create script here
     123    String statCmd = "./mut_stats.py";
     124    statCmd += " ${WD}/vcflist.txt";
     125    statCmd += " > mut_stats.vcf";
     126    script.cmd(statCmd);
     127    script.cmd(bedtools_path+" sort -header -i mut_stats.vcf | bgzip -c > mut_stats.vcf.gz");
     128    script.cmd("tabix mut_stats.vcf.gz");
    114129   
    115130    script.progress(99, "Cleaning up temporary folders");
     
    163178      }
    164179      String patient = patients.get(0).getName();
    165       String dataFolder = (String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, manager, alignment);
    166       tw.tablePrintData(patient, dataFolder+"/variants-raw.vcf.gz");
     180      String dataFolder = ScriptUtil.checkValidPath((String)Annotationtype.DATA_FILES_FOLDER.getAnnotationValue(dc, manager, alignment), true, true);
     181      tw.tablePrintData(patient, projectRoot + dataFolder+"/variants-raw.vcf.gz");
    167182    }
    168183    tw.flush();
Note: See TracChangeset for help on using the changeset viewer.