MCPcopy Create free account
hub / github.com/openai/plugins / build_qiime2_plan

Function build_qiime2_plan

plugins/ngs-analysis/scripts/run_amplicon_microbiome.py:125–273  ·  view source on GitHub ↗
(
    args: argparse.Namespace, samples: list[dict[str, str]]
)

Source from the content-addressed store, hash-verified

123
124
125def build_qiime2_plan(
126 args: argparse.Namespace, samples: list[dict[str, str]]
127) -> list[dict[str, Any]]:
128 paired = any(row["r2"] for row in samples)
129 manifest = "workflow/qiime2_manifest.tsv"
130 plan = [
131 command_plan_entry(
132 "import FASTQs",
133 [
134 "qiime",
135 "tools",
136 "import",
137 "--type",
138 "SampleData[PairedEndSequencesWithQuality]"
139 if paired
140 else "SampleData[SequencesWithQuality]",
141 "--input-path",
142 manifest,
143 "--output-path",
144 "qiime2/demux.qza",
145 "--input-format",
146 "PairedEndFastqManifestPhred33V2" if paired else "SingleEndFastqManifestPhred33V2",
147 ],
148 outputs=["qiime2/demux.qza"],
149 ),
150 command_plan_entry(
151 "trim primers",
152 [
153 "qiime",
154 "cutadapt",
155 "trim-paired" if paired else "trim-single",
156 "--i-demultiplexed-sequences",
157 "qiime2/demux.qza",
158 "--p-front-f",
159 args.primer_forward,
160 "--p-front-r",
161 args.primer_reverse,
162 "--o-trimmed-sequences",
163 "qiime2/trimmed.qza",
164 ],
165 outputs=["qiime2/trimmed.qza"],
166 ),
167 command_plan_entry(
168 "DADA2 denoise",
169 [
170 "qiime",
171 "dada2",
172 "denoise-paired" if paired else "denoise-single",
173 "--i-demultiplexed-seqs",
174 "qiime2/trimmed.qza",
175 "--p-trunc-len-f",
176 str(args.trunc_len_f or 0),
177 "--p-trunc-len-r",
178 str(args.trunc_len_r or 0),
179 "--o-table",
180 "qiime2/table.qza",
181 "--o-representative-sequences",
182 "qiime2/rep-seqs.qza",

Callers 1

build_planFunction · 0.85

Calls 1

command_plan_entryFunction · 0.90

Tested by

no test coverage detected