rule spades_get_fastq:
    """ If the careful option is used, this rule get corrected fastq files.

    Required input:
        - __spades_get_fastq__input: fasta created by spades.
        - __spades_get_fastq__yaml: corrected.yaml created by spades.
    
    Required output:
        - __spades_get_fastq__output: list of fastq file [R1, R2]
    """
    input:
        fa = __spades_get_fastq__input
    output:
        fastq = __spades_get_fastq__output
    params:
        yaml = __spades_get_fastq__yaml
    run:
        import yaml
        import shutil

        with open(params["yaml"], 'r') as fp:
            fyml = yaml.load(fp)[0]
        shutil.copy(fyml["left reads"][0], output["fastq"][0])
        shutil.copy(fyml["right reads"][0], output["fastq"][1])
