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

SDAP-1261-refactor-k2 #225

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 14 additions & 48 deletions tools/bypass-trimgalore-pe.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ inputs:
type: string?
default: |
#!/bin/bash
exec 1> error_msg.txt 2>&1
printf "bypass-trimgalore-pe.cwl\n$(date)\n"

ORIGINAL_FASTQ_1=$0
TRIMMED_FASTQ_1=$1
TRIMMING_REPORT_1=$2
Expand Down Expand Up @@ -93,6 +96,16 @@ inputs:

outputs:

error_msg:
type: File?
outputBinding:
glob: "error_msg.txt"

error_report:
type: File?
outputBinding:
glob: "error_report.txt"

selected_fastq_file_1:
type: File
outputBinding:
Expand All @@ -117,55 +130,8 @@ outputs:
baseCommand: ["bash", "-c"]


$namespaces:
s: http://schema.org/

$schemas:
- https://github.com/schemaorg/schemaorg/raw/main/data/releases/11.01/schemaorg-current-http.rdf


s:name: "bypass-trimgalore-pe"
s:downloadUrl: https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/bypass-trimgalore-pe.cwl
s:codeRepository: https://github.com/Barski-lab/workflows
s:license: http://www.apache.org/licenses/LICENSE-2.0

s:isPartOf:
class: s:CreativeWork
s:name: Common Workflow Language
s:url: http://commonwl.org/

s:creator:
- class: s:Organization
s:legalName: "Cincinnati Children's Hospital Medical Center"
s:location:
- class: s:PostalAddress
s:addressCountry: "USA"
s:addressLocality: "Cincinnati"
s:addressRegion: "OH"
s:postalCode: "45229"
s:streetAddress: "3333 Burnet Ave"
s:telephone: "+1(513)636-4200"
s:logo: "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
s:department:
- class: s:Organization
s:legalName: "Allergy and Immunology"
s:department:
- class: s:Organization
s:legalName: "Barski Research Lab"
s:member:
- class: s:Person
s:name: Michael Kotliar
s:email: mailto:[email protected]
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898

label: "bypass-trimgalore-pe"
doc: |
If the number of reads in the trimmed_fastq_file_1 is less then min_reads_count, tool
will return original_fastq_file_1/2 and nulls as selected_report_file_1/2. Otherwise,
the trimmed_fastq_file_1/2 and trimming_report_file_1/2 will be returned. Might be
usefull in case of trimgalore removed all reads from the original_fastq_file_1/2.

s:about: |
If the number of reads in the trimmed_fastq_file_1 is less then min_reads_count, tool
will return original_fastq_file_1/2 and nulls as selected_report_file_1/2. Otherwise,
the trimmed_fastq_file_1/2 and trimming_report_file_1/2 will be returned. Might be
Expand Down
52 changes: 4 additions & 48 deletions tools/bypass-trimgalore-se.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ inputs:
type: string?
default: |
#!/bin/bash
exec 1> error_msg.txt 2>&1
printf "bypass-trimgalore-se.cwl\n$(date)\n"

ORIGINAL_FASTQ=$0
TRIMMED_FASTQ=$1
TRIMMING_REPORT=$2
Expand Down Expand Up @@ -79,55 +82,8 @@ outputs:
baseCommand: ["bash", "-c"]


$namespaces:
s: http://schema.org/

$schemas:
- https://github.com/schemaorg/schemaorg/raw/main/data/releases/11.01/schemaorg-current-http.rdf


s:name: "bypass-trimgalore-se"
s:downloadUrl: https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/bypass-trimgalore-se.cwl
s:codeRepository: https://github.com/Barski-lab/workflows
s:license: http://www.apache.org/licenses/LICENSE-2.0

s:isPartOf:
class: s:CreativeWork
s:name: Common Workflow Language
s:url: http://commonwl.org/

s:creator:
- class: s:Organization
s:legalName: "Cincinnati Children's Hospital Medical Center"
s:location:
- class: s:PostalAddress
s:addressCountry: "USA"
s:addressLocality: "Cincinnati"
s:addressRegion: "OH"
s:postalCode: "45229"
s:streetAddress: "3333 Burnet Ave"
s:telephone: "+1(513)636-4200"
s:logo: "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
s:department:
- class: s:Organization
s:legalName: "Allergy and Immunology"
s:department:
- class: s:Organization
s:legalName: "Barski Research Lab"
s:member:
- class: s:Person
s:name: Michael Kotliar
s:email: mailto:[email protected]
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898

label: "bypass-trimgalore-se"
doc: |
If the number of reads in the trimmed_fastq_file is less then min_reads_count, tool
will return original_fastq_file and null as selected_report_file. Otherwise, the
trimmed_fastq_file and trimming_report_file will be returned. Might be usefull in
case of trimgalore removed all reads from the original_fastq_file

s:about: |
If the number of reads in the trimmed_fastq_file is less then min_reads_count, tool
will return original_fastq_file and null as selected_report_file. Otherwise, the
trimmed_fastq_file and trimming_report_file will be returned. Might be usefull in
Expand Down
77 changes: 24 additions & 53 deletions tools/extract-fastq.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,16 @@ hints:

inputs:

script:
script_command:
type: string?
default: |
#!/bin/bash
exec 1> error_msg.txt 2>&1
printf "extract-fastq.cwl\n$(date)\n"
printf "INPUTS:\n"
printf "\$0 - $0\n"
printf "\$1 - $1\n\n"

shopt -s nocaseglob

COMBINED="$0".fastq
Expand All @@ -35,7 +41,7 @@ inputs:
cat "${FILE}" >> "${COMBINED}" || true
;;
*)
echo "Error: file type unknown"
echo "Error: file type '${T}' unknown" > error_report.txt
rm -f "${COMBINED}"
exit 1
esac
Expand All @@ -48,16 +54,14 @@ inputs:

inputBinding:
position: 5
doc: |
Bash script to extract compressed FASTQ file
doc: "Bash script to extract compressed FASTQ file"

output_prefix:
type: string?
inputBinding:
position: 6
default: "merged"
doc: |
Output prefix for extracted file
doc: "Output prefix for extracted file"

compressed_file:
type:
Expand All @@ -66,61 +70,31 @@ inputs:
items: File
inputBinding:
position: 7
doc: |
Compressed or uncompressed FASTQ file(s)
doc: "Compressed or uncompressed FASTQ file(s)"


outputs:

error_msg:
type: File?
outputBinding:
glob: "error_msg.txt"

error_report:
type: File?
outputBinding:
glob: "error_report.txt"

fastq_file:
type: File
outputBinding:
glob: "*"
glob: "*.fastq"

baseCommand: [bash, '-c']

baseCommand: [bash, '-c']

$namespaces:
s: http://schema.org/

$schemas:
- https://github.com/schemaorg/schemaorg/raw/main/data/releases/11.01/schemaorg-current-http.rdf

s:name: "extract-fastq"
s:downloadUrl: https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/extract-fastq.cwl
s:codeRepository: https://github.com/Barski-lab/workflows
s:license: http://www.apache.org/licenses/LICENSE-2.0

s:isPartOf:
class: s:CreativeWork
s:name: Common Workflow Language
s:url: http://commonwl.org/

s:creator:
- class: s:Organization
s:legalName: "Cincinnati Children's Hospital Medical Center"
s:location:
- class: s:PostalAddress
s:addressCountry: "USA"
s:addressLocality: "Cincinnati"
s:addressRegion: "OH"
s:postalCode: "45229"
s:streetAddress: "3333 Burnet Ave"
s:telephone: "+1(513)636-4200"
s:logo: "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
s:department:
- class: s:Organization
s:legalName: "Allergy and Immunology"
s:department:
- class: s:Organization
s:legalName: "Barski Research Lab"
s:member:
- class: s:Person
s:name: Michael Kotliar
s:email: mailto:[email protected]
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898

label: "extract-fastq"
doc: |
Tool to decompress input FASTQ file(s).
If several FASTQ files are provided, they will be concatenated in the order that corresponds to files in input.
Expand All @@ -131,6 +105,3 @@ doc: |
- check file type, decompress if needed
- return 1, if file type is not recognized
This script also works of input file doesn't have any extension at all

s:about: |
Tool to decompress input FASTQ file
57 changes: 12 additions & 45 deletions tools/fastx-quality-stats.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,17 @@ inputs:
Output file to store generated statistics. If not provided - return from default_output_filename function

outputs:

error_msg:
type: File?
outputBinding:
glob: "error_msg.txt"

error_report:
type: File?
outputBinding:
glob: "error_report.txt"

statistics_file:
type: File
outputBinding:
Expand All @@ -88,56 +99,12 @@ outputs:
baseCommand: [fastx_quality_stats]


$namespaces:
s: http://schema.org/

$schemas:
- https://github.com/schemaorg/schemaorg/raw/main/data/releases/11.01/schemaorg-current-http.rdf

s:mainEntity:
$import: ./metadata/fastx-toolkit-metadata.yaml

s:name: "fastx-quality-stats"
s:downloadUrl: https://raw.githubusercontent.com/Barski-lab/workflows/master/tools/fastx-quality-stats.cwl
s:codeRepository: https://github.com/Barski-lab/workflows
s:license: http://www.apache.org/licenses/LICENSE-2.0

s:isPartOf:
class: s:CreativeWork
s:name: Common Workflow Language
s:url: http://commonwl.org/

s:creator:
- class: s:Organization
s:legalName: "Cincinnati Children's Hospital Medical Center"
s:location:
- class: s:PostalAddress
s:addressCountry: "USA"
s:addressLocality: "Cincinnati"
s:addressRegion: "OH"
s:postalCode: "45229"
s:streetAddress: "3333 Burnet Ave"
s:telephone: "+1(513)636-4200"
s:logo: "https://www.cincinnatichildrens.org/-/media/cincinnati%20childrens/global%20shared/childrens-logo-new.png"
s:department:
- class: s:Organization
s:legalName: "Allergy and Immunology"
s:department:
- class: s:Organization
s:legalName: "Barski Research Lab"
s:member:
- class: s:Person
s:name: Michael Kotliar
s:email: mailto:[email protected]
s:sameAs:
- id: http://orcid.org/0000-0002-6486-3898

label: "fastx-quality-stats"
doc: |
Tool calculates statistics on the base of FASTQ file quality scores.
If `output_filename` is not provided call function `default_output_filename` to return default output file name
generated as `input_file` basename + `.fastxstat` extension.

s:about: |
usage: fastx_quality_stats [-h] [-N] [-i INFILE] [-o OUTFILE]
Part of FASTX Toolkit 0.0.14 by A. Gordon ([email protected])
[-h] = This helpful help screen.
Expand Down
Loading