Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workflow to convert (many) .sig/.sig.gz files to .sig.zip files + mf.csv files #3349

Open
ctb opened this issue Oct 13, 2024 · 1 comment
Open
Labels
code herein lies code

Comments

@ctb
Copy link
Contributor

ctb commented Oct 13, 2024

on farm at /home/ctbrown/scratch/2022-branchwater-benchmarking/wort-list-d.d/Snakefile -

# convert a bunch of .sig files into .sig.zip files and also produce .mf.csv fil
es.

FILELIST='../data/wort-list-d.txt'

siglist = [ x.strip() for x in open(FILELIST) ]
print(f"loaded '{len(siglist)}' files")

#print('selecting 10...')
#siglist = siglist[:10]

ACCS = [ os.path.basename(x).split('.')[0] for x in siglist ]


rule all:
    input:
        expand('{acc}.sig.zip', acc=ACCS),
        expand('{acc}.mf.csv', acc=ACCS)

rule make_sig_zip:
    output: "{acc}.sig.zip"
    shell: """
        sourmash sig cat /group/ctbrowngrp/irber/data/wort-data/wort-sra/sigs/{w
ildcards.acc}.sig -o {output}
    """

rule make_mf_csv:
    input: "{acc}.sig.zip",
    output: "{acc}.mf.csv",
    shell: """
        sourmash sig collect {input} -o {output} -F csv --abspath
    """
@ctb
Copy link
Contributor Author

ctb commented Oct 13, 2024

to produce a standalone manifest from the mf.csv files (and also probably from the zip files), do

sourmash sig collect -F csv *.mf.csv -o combined.mf.csv --abspath

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code herein lies code
Projects
None yet
Development

No branches or pull requests

1 participant