Skip to content

Commit

Permalink
Merge pull request #88 from sanger-bentley-group/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
blue-moon22 authored Mar 28, 2023
2 parents ed997ea + 52e657a commit 4ab2c27
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions bin/process_serotyper_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 1 addition & 10 deletions modules/serotyping.nf
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
}
2 changes: 1 addition & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ py==1.10.0
pyparsing==2.4.7
pytest==6.2.4
toml==0.10.2
pandas==1.5.3
2 changes: 1 addition & 1 deletion tests/process_serotyper_results_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 4ab2c27

Please sign in to comment.