diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0fc52f7..fe0cfbe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,13 +11,13 @@ on: jobs: test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: - python-version: 3.6 + python-version: 3.9 - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/README.md b/README.md index e425283..3da0fe9 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,9 @@ Sample_id | Serotype | 23S1 | 23S3 | CAT | ermB | ermT | FOSA | GYRA | lnuB | ls Gives the SNP variants for GBS-specific resistance genes e.g. Isolate Strep B sample 25292_2#105 have common variants 23S1, 23S3 and GYRA (shown with *), but replacement of amino acid S by Q in position 17 of the PARC protein sequence -Sample_id | 23S1 | 23S3 | GYRA | PARC | RPOBGBS-1 | RPOBGBS-2 | RPOBGBS-3 | RPOBGBS-4 -:---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: -25292_2#105 | * | * | * | Q17S | | | | | +Sample_id | 23S1 | 23S3 | GYRA | PARC +:---: | :---: | :---: | :---: | :---: +25292_2#105 | * | * | * | Q17S 3. **drug_cat_alleles_variants.txt** @@ -141,14 +141,13 @@ Sample_id | ALPH | hvgA | PILI | SRR --other_res_min_coverage Minimum coverage for mapping to other resistance reference database(s). (Default: 70) --other_res_max_divergence Maximum divergence for mapping to other resistance reference database. (Default: 30, i.e. report only hits with <30% divergence) --restyper_min_read_depth Minimum read depth where mappings to antibiotic resistance genes with fewer reads are excluded. (Default: 30) - --serotyper_min_read_depth Minimum read depth where mappings to serotyping genes with fewer reads are excluded. (Default: 30) + --serotyper_min_read_depth Minimum read depth where mappings to serotyping genes with fewer reads are excluded. (Default: 0) ### Other Workflow Options --run_sero_res Run the main serotyping and resistance workflows. (Default: true) - Use '--run_sero_res false' to override the default. - --run_surfacetyper Run the surface protein typing workflow. (Default: false) + --run_surfacetyper Run the surface protein typing workflow. (Default: true) --run_mlst Run the MLST workflow to query existing sequence types and new MLST alleles. (Default: true) - --run_pbptyper Run the PBP (Penicillin binding protein) allele typer workflow. Must also specify --contigs input. (Default: true) + --run_pbptyper Run the PBP (Penicillin binding protein) allele typer workflow. Must also specify --contigs input. (Default: false) ### Other Parameters --mlst_min_read_depth Minimum read depth where mappings to alleles in MLST with fewer reads are excluded. Only operational with --run_mlst. (Default: 30) diff --git a/bin/process_serotyper_results.py b/bin/process_serotyper_results.py index 1f832cc..92c0a95 100755 --- a/bin/process_serotyper_results.py +++ b/bin/process_serotyper_results.py @@ -58,8 +58,8 @@ def get_arguments(): help='Input fullgenes results tab file.') parser.add_argument('--output', '-o', dest='output', required=True, help='Output filename.') - parser.add_argument('--min_read_depth', '-d', dest='depth', default = 30, type=float, - help='Minimum read depth where mappings with fewer reads are excluded. Default: 30.') + parser.add_argument('--min_read_depth', '-d', dest='depth', default = 0, type=float, required=False, + help='Minimum read depth where mappings with fewer reads are excluded. Default: 0.') return parser diff --git a/modules/serotyping.nf b/modules/serotyping.nf index 581b0e4..55dccf8 100644 --- a/modules/serotyping.nf +++ b/modules/serotyping.nf @@ -19,18 +19,9 @@ process serotyping { git clone https://github.com/swainechen/GBS-SBG mv GBS-SBG/${sero_gene_db} . - srst2 --samtools_args '\\-A' --input_pe ${reads[0]} ${reads[1]} --output SERO_${pair_id} --log --save_scores --min_coverage 99.0 --max_divergence 7 --gene_db ${sero_gene_db} + srst2 --samtools_args '\\-A' --input_pe ${reads[0]} ${reads[1]} --output SERO_${pair_id} --log --save_scores --gene_db ${sero_gene_db} process_serotyper_results.py --srst2_output SERO_${pair_id} --sero_db ${sero_gene_db} --output ${pair_id}_SeroType_Results.txt --min_read_depth ${min_read_depth} touch ${output_file} - - # Clean directory - mkdir output - mv ${output_file} output - find . -maxdepth 1 -type f -delete - unlink ${reads[0]} - unlink ${reads[1]} - mv output/${output_file} . - rm -d output """ } diff --git a/nextflow.config b/nextflow.config index 9047173..5f186b9 100644 --- a/nextflow.config +++ b/nextflow.config @@ -17,7 +17,7 @@ params { results_dir = "" config = "./headers.json" contigs = "" - serotyper_min_read_depth = 30 + serotyper_min_read_depth = 0 gbs_blactam_db = "$db_dir/GBS_bLactam-DB/GBS_bLactam_Ref.fasta" gbs_blactam_1A_db = "$db_dir/GBS_bLactam-DB/GBS_bLactam_1A-DB.faa" gbs_blactam_2B_db = "$db_dir/GBS_bLactam-DB/GBS_bLactam_2B-DB.faa" diff --git a/requirements.txt b/requirements.txt index 2417e47..47a684d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,3 +8,4 @@ py==1.10.0 pyparsing==2.4.7 pytest==6.2.4 toml==0.10.2 +pandas==1.5.3 diff --git a/tests/process_serotyper_results_test.py b/tests/process_serotyper_results_test.py index bccc9e9..e1235b1 100644 --- a/tests/process_serotyper_results_test.py +++ b/tests/process_serotyper_results_test.py @@ -48,4 +48,4 @@ def test_arguments_short_options(self): def test_arguments_without_depth_threshold(self): actual = get_arguments().parse_args(['-s', 'srst2_output_name', '-b', 'sero_db', '-o', 'outfile']) self.assertEqual(actual, - argparse.Namespace(id='srst2_output_name', db='sero_db', output='outfile', depth=30.0)) + argparse.Namespace(id='srst2_output_name', db='sero_db', output='outfile', depth=0))