INNER CODE UNIT · Python

get_ids_from_path_pattern

franciscozorrilla/metaGEM · workflow/rules/Snakefile_single_end.smk.py:6

def get_ids_from_path_pattern(path_pattern):
    ids = sorted([os.path.basename(os.path.splitext(val)[0])
                  for val in (glob.glob(path_pattern))])
    return ids

# Make sure that final_bins/ folder contains all bins in single folder for binIDs
# wildcard to work. Use extractProteinBins rule or perform manually.
binIDs = get_ids_from_path_pattern('final_bins/*.faa')
IDs = get_ids_from_path_pattern('assemblies/*')

DATA_READS = f'{config["path"]["root"]}/{config["folder"]["data"]}/{{IDs}}/{{IDs}}.fastq.gz'

# Inserting space here to avoid having to change the hardcoded line 22 edit in the metabagpipes parser to expand wildcards

rule all:
    input:
        expand(f'{config["path"]["root"]}/GTDBtk/{{IDs}}', IDs=IDs)
    message:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…