def test_indel_consensus_case_3(): ''' test consensus.indel_consensus() with identical record between freebayes/samtools Parameters --------- Returns ------- ''' chrom, pos, ref, alt, record = _get_test_record() test_record = {(chrom, pos, ref, alt): record} freebayes = test_record rtg = [] samtools = test_record consensus_data = consensus.indel_consensus(freebayes, rtg, samtools) consensus_data = pd.DataFrame(consensus_data, columns=["chrom", "pos", "ref", "alt", "id_counter", "qual", "filter", "nr", "na", "nd"] ) consensus_data = consensus_data.astype({"chrom": "str"}) assert not consensus_data[(consensus_data.pos == pos) & (consensus_data["chrom"] == chrom)].empty
def test_indel_consensus_case_4(): ''' test consensus.snv_consensus() with empty data Parameters testdir: str directory --------- Returns ------- ''' consensus_data = consensus.indel_consensus([], [], []) assert consensus_data == []
def test_indel_consensus_case_5(): ''' test consensus.snv_consensus() with no shared records Parameters testdir: str directory --------- Returns ------- ''' chrom, pos, ref, alt, record = _get_test_record() samtools = {(chrom, pos + 2, ref, alt): record} freebayes = {(chrom, pos + 3, ref, alt): record} rtg = {(chrom, pos + 4, ref, alt): record} consensus_data = consensus.indel_consensus(samtools, freebayes, rtg) assert consensus_data == []