コード例 #1
0
ファイル: picardtools.py プロジェクト: GeoffColburn/pydcamp
def mark_duplicates(bam_path, output_bam_path, output_metrics_path):
    cmd = "java -Xmx1g -jar {} \
          INPUT={} \
          OUTPUT={} \
          METRICS_FILE={}"\
          .format(_MARK_DUPLICATES, bam_path, output_bam_path, output_metrics_path)
    common.system(cmd)
    common.assert_file(output_bam_path, cmd)
    common.assert_file(output_metrics_path, cmd)

    return output_bam_path
コード例 #2
0
ファイル: samtools.py プロジェクト: GeoffColburn/pydcamp
def view(bam_path, sam_path):
    cmd = samtools_exe + " view -hbS -o {} {}".format(bam_path, sam_path)
    common.system(cmd) 
    common.assert_file(bam_path, cmd)
    return bam_path
コード例 #3
0
ファイル: samtools.py プロジェクト: GeoffColburn/pydcamp
def mpileup(fasta_path, bam_sorted_path, out_vcf_path):
    cmd = samtools_exe + " mpileup -uf {} {} | bcftools view -vcg - > {}".format(fasta_path, bam_sorted_path, out_vcf_path)
    common.system(cmd)
    common.assert_file(out_vcf_path, cmd)
    return out_vcf_path
コード例 #4
0
ファイル: samtools.py プロジェクト: GeoffColburn/pydcamp
def index(bam_path):
    cmd = samtools_exe + " index {}".format(bam_path)
    common.system(cmd)
    common.assert_file(bam_path, cmd)
    return bam_path
コード例 #5
0
ファイル: samtools.py プロジェクト: GeoffColburn/pydcamp
def merge(sam_paths, merged_bam_path, bam_paths):
    cmd = samtools_exe + " merge -r -n -h {} {} {}".format(" -h ".join(sam_paths), merged_bam_path, " ".join(bam_paths))
    common.system(cmd)
    common.assert_file(merged_bam_path, cmd)
    return merged_bam_path
コード例 #6
0
ファイル: samtools.py プロジェクト: GeoffColburn/pydcamp
def sort(bam_path, bam_sorted_prefix):       
    cmd = samtools_exe + " sort {} {}".format(bam_path, bam_sorted_prefix)
    sorted_bam_path = bam_sorted_prefix + ".bam" 
    common.system(cmd)
    common.assert_file(sorted_bam_path, cmd)
    return sorted_bam_path
コード例 #7
0
ファイル: picardtools.py プロジェクト: GeoffColburn/pydcamp
def merge_sams(sam_paths, output, merge_seq_dicts = True):
    cmd = "java -jar {} INPUT={} OUTPUT={} MERGE_SEQUENCE_DICTIONARIES={}".format(_MERGE_SAMS," INPUT=".join(sam_paths), output, "true" if merge_seq_dicts else "false")
    common.system(cmd)
    common.assert_file(output, cmd)
    return output
コード例 #8
0
ファイル: picardtools.py プロジェクト: GeoffColburn/pydcamp
def sort_sam(aln_path, output_aln_path, sort_option = "coordinate"):
    cmd = "java -jar {} INPUT={} OUTPUT={} SORT_ORDER={}".format(_SORT_SAM, aln_path, output_aln_path, sort_option)
    common.system(cmd)
    common.assert_file(output_aln_path, cmd)
    return output_aln_path
コード例 #9
0
ファイル: picardtools.py プロジェクト: GeoffColburn/pydcamp
def create_sequence_dictionary(ref_path, output_path):
    cmd = "java -jar {} R={} O={}".format(_CREATE_SEQUENCE_DICTIONARY, ref_path, output_path)
    common.system(cmd)
    common.assert_file(output_path, cmd)
    return output_path
コード例 #10
0
ファイル: picardtools.py プロジェクト: GeoffColburn/pydcamp
def add_or_replace_read_groups(input_path, output_path):
    cmd = "java -jar {} I={} O={} LB=FOO PL=ILLUMINA PU=BAR SM=NEE".format(_ADD_OR_REPLACE_READ_GROUPS, input_path, output_path)
    common.system(cmd) 
    common.assert_file(output_path, cmd)
    return output_path