예제 #1
0
def test_interleaved_pair_aligner_run():
    input1 = files.open(testfiles["reads_1.fastq"])
    input2 = files.open(testfiles["reads_2.fastq"])
    mappings = gem.mapper(filter.interleave([input1, input2]), index)
    paired = gem.pairalign(mappings, index)
    assert paired is not None
    assert sum(1 for x in paired) == 20000  # test dataset does not pair at all
예제 #2
0
def test_interleaved_pair_aligner_run():
    input1 = files.open(testfiles["reads_1.fastq"])
    input2 = files.open(testfiles["reads_2.fastq"])
    mappings = gem.mapper(filter.interleave([input1, input2]), index)
    paired = gem.pairalign(mappings, index)
    assert paired is not None
    assert sum(1 for x in paired) == 20000  # test dataset does not pair at all
    ).merge(merge_out) # write to file


    ## remove files
    if REMOVE_FILES:
        print "Removing intermediate files"
        os.remove(initial_out)
        os.remove(initial_split_out)
        os.remove(denovo_out)
        os.remove(junctions_out)
        os.remove(trim_20_out)
        os.remove(trim_20_split_out)

    ## pair align the mappings
    print "Running pair aligner"
    paired_mapping = gem.pairalign(merged, index, paired_out, max_insert_size=100000, threads=THREADS)

    if REMOVE_FILES:
        os.remove(merge_out)

    ## validate and score the alignment
    print "Validating and scoring alignment"
    scored = gem.score(paired_mapping, index, final_out, threads=THREADS)
    if REMOVE_FILES:
        os.remove(paired_out)

    ## convert the result to sam and then to bam
    print "Converting to sam"
    sam = gem.gem2sam(scored, index, threads=4)
    bam = gem.sam2bam(sam, sam_out, sorted=True)