-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added cli option for sample sheet generation
- Loading branch information
1 parent
4ff89a4
commit 1367769
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import click | ||
import pathlib as p | ||
import errno as e | ||
import sys | ||
|
||
from mikrokondo_tools.samplesheet import samplesheet as ss | ||
import mikrokondo_tools.utils as u | ||
|
||
@click.command(short_help="Generate a sample sheet for mikrokondo.", no_args_is_help=True) | ||
@click.option("-o", "--output-sheet", "output_sheet", required=True, type=click.Path(), help="The file to write your created output sheet to, this directory must already exist.") | ||
@click.option("-1", "--read-1-suffix", "read_1", type=click.STRING, help="A suffix to identify read 1", default="_R1_") | ||
@click.option("-2", "--read-2-suffix", "read_2", type=click.STRING, help="A suffix to identify read 2", default="_R2_") | ||
@click.option("-s", "--schema-input", "schema_input", type=click.Path(), default=None, help="An optional schema_input.json file pre-downloaded for mikrokondo.") | ||
@click.argument("sample_directory", type=click.Path(exists=True)) | ||
def samplesheet(output_sheet, read_1, read_2, input_directory, schema_input): | ||
logger = u.get_logger() | ||
if output_sheet.is_file(): | ||
logger.error("Input sample sheet already exists, please re-name your new sheet or the existing one. %s", output_sheet) | ||
sys.exit(e.EEXIST) | ||
|
||
data = ss.get_samples(p.Path(input_directory)) | ||
ngs_data = ss.NGSData(data[0], data[1], read_1, read_2, p.Path(output_sheet), schema_input) | ||
return ngs_data.create_sample_sheet() |