<commit_before>from snakemake.utils import R

def getContigNames():
    if isinstance(config['resources'][ORGANISM]['contigNames'], Error):
        return ["ERROR"]
    f = open(config['resources'][ORGANISM]['contigNames'],'r')
    result = []
    for line in f:
        result.append(line.strip())
    return result

# This rule uses the custom samtools version of bicSeq2 to extract unique mappings for bicSeq2
if not 'BICSEQ2IN' in globals():
    BICSEQ2IN = REMOVEPCRDUBLICATESOUT
if not 'BICSEQ2OUT' in globals():
    BICSEQ2OUT = OUTDIR + 'bicseq2/'
rule bicSeq_samtoolsUnique:
    input:
        bam = BICSEQ2IN + '{sample}.bam'
    output:
        seq = expand(BICSEQ2OUT + '{{sample}}' + '/{contigNames}.seq', contigNames=getContigNames())
    params:
        lsfoutfile = BICSEQ2OUT + '{sample}/unique.lsfout.log',
        lsferrfile = BICSEQ2OUT + '{sample}/unique.lsferr.log',
        scratch = config['tools']['bicseq2']['unique']['scratch'],
        mem = config['tools']['bicseq2']['unique']['mem'],
        time = config['tools']['bicseq2']['unique']['time'],
        mapper = config['tools']['bicseq2']['unique']['mapper'],
        directory = BICSEQ2OUT + '{sample}' + '/'
    threads:
        config['tools']['bicseq2']['unique']['threads']
    benchmark:
        BICSEQ2OUT + '{sample}/unique.benchmark'
    shell:
        ('mkdir -p {params.directory} && ' +
        '{config[tools][bicseq2][unique][call]} view -U {params.mapper},{params.directory},N,N {input.bam}')

rule extractContigsFromFasta:
    input:<commit_msg>[FIX] Made contigNames a required file for bicseq2<commit_after>from snakemake.utils import R

def getContigNames():
    if isinstance(config['resources'][ORGANISM]['contigNames'], Error):
        return ["ERROR"]
    f = open(config['resources'][ORGANISM]['contigNames'],'r')
    result = []
    for line in f:
        result.append(line.strip())
    return result

# This rule uses the custom samtools version of bicSeq2 to extract unique mappings for bicSeq2
if not 'BICSEQ2IN' in globals():
    BICSEQ2IN = REMOVEPCRDUBLICATESOUT
if not 'BICSEQ2OUT' in globals():
    BICSEQ2OUT = OUTDIR + 'bicseq2/'
rule bicSeq_samtoolsUnique:
    input:
        bam = BICSEQ2IN + '{sample}.bam',
        contigNamnes =config['resources'][ORGANISM]['contigNames']
    output:
        seq = expand(BICSEQ2OUT + '{{sample}}' + '/{contigNames}.seq', contigNames=getContigNames())
    params:
        lsfoutfile = BICSEQ2OUT + '{sample}/unique.lsfout.log',
        lsferrfile = BICSEQ2OUT + '{sample}/unique.lsferr.log',
        scratch = config['tools']['bicseq2']['unique']['scratch'],
        mem = config['tools']['bicseq2']['unique']['mem'],
        time = config['tools']['bicseq2']['unique']['time'],
        mapper = config['tools']['bicseq2']['unique']['mapper'],
        directory = BICSEQ2OUT + '{sample}' + '/'
    threads:
        config['tools']['bicseq2']['unique']['threads']
    benchmark:
        BICSEQ2OUT + '{sample}/unique.benchmark'
    shell:
        ('mkdir -p {params.directory} && ' +
        '{config[tools][bicseq2][unique][call]} view -U {params.mapper},{params.directory},N,N {input.bam}')

rule extractContigsFromFasta:
    input:
{'fraction_non_alphanumeric': 0.17121354656632173, 'fraction_numerical': 0.012229539040451553, 'mean_word_length': 3.7611940298507465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6531681', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1018, 'n_words': 204}