forked from JoseEspinosa/nf-core-rnaseq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from BovReg/bovreg_stringtie_annotation
Bovreg_stringtie_annotation -> Master for v3.3-BOVREG-1
- Loading branch information
Showing
158 changed files
with
1,443 additions
and
216 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
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 |
---|---|---|
@@ -1,44 +1,34 @@ | ||
name: nf-core AWS full size tests | ||
# This workflow is triggered on published releases. | ||
# It can be additionally triggered manually with GitHub actions workflow dispatch. | ||
# It can be additionally triggered manually with GitHub actions workflow dispatch button. | ||
# It runs the -profile 'test_full' on AWS batch | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
TOWER_ACCESS_TOKEN: ${{ secrets.AWS_TOWER_TOKEN }} | ||
AWS_JOB_DEFINITION: ${{ secrets.AWS_JOB_DEFINITION }} | ||
AWS_JOB_QUEUE: ${{ secrets.AWS_JOB_QUEUE }} | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
|
||
jobs: | ||
run-awstest: | ||
run-tower: | ||
name: Run AWS full tests | ||
if: github.repository == 'nf-core/rnaseq' | ||
runs-on: ubuntu-latest | ||
# Do a full-scale run with each of the three aligners | ||
strategy: | ||
matrix: | ||
aligner: ['star_salmon', 'star_rsem', 'hisat2'] | ||
aligner: ["star_salmon", "star_rsem", "hisat2"] | ||
steps: | ||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
- name: Launch workflow via tower | ||
uses: nf-core/tower-action@master | ||
with: | ||
auto-update-conda: true | ||
python-version: 3.7 | ||
- name: Install awscli | ||
run: conda install -c conda-forge awscli | ||
- name: Start AWS batch job | ||
# Do a full-scale run with each of the three aligners | ||
run: | | ||
aws batch submit-job \ | ||
--region eu-west-1 \ | ||
--job-name nf-core-rnaseq \ | ||
--job-queue $AWS_JOB_QUEUE \ | ||
--job-definition $AWS_JOB_DEFINITION \ | ||
--container-overrides '{"command": ["nf-core/rnaseq", "-r '"${GITHUB_SHA}"' -profile test_full --aligner '"${{matrix.aligner}}"' --outdir s3://'"${AWS_S3_BUCKET}"'/rnaseq/results-'"${GITHUB_SHA}"'/aligner_'"${{matrix.aligner}}"' -w s3://'"${AWS_S3_BUCKET}"'/rnaseq/work-'"${GITHUB_SHA}"'/'"${{matrix.aligner}}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}' | ||
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} | ||
bearer_token: ${{ secrets.TOWER_BEARER_TOKEN }} | ||
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} | ||
pipeline: ${{ github.repository }} | ||
revision: ${{ github.sha }} | ||
workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/rnaseq/work-${{ github.sha }} | ||
parameters: | | ||
{ | ||
"outdir" : "s3://${{ secrets.AWS_S3_BUCKET }}/rnaseq/results-${{ github.sha }}/aligner_${{ matrix.aligner }}", | ||
"aligner": "${{ matrix.aligner }}" | ||
} | ||
profiles: '[ "test_full", "aws_tower" ]' |
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 |
---|---|---|
@@ -1,37 +1,27 @@ | ||
name: nf-core AWS test | ||
# This workflow is triggered on push to the master branch. | ||
# It can be additionally triggered manually with GitHub actions workflow dispatch. | ||
# It runs the -profile 'test' on AWS batch. | ||
# This workflow can be triggered manually with the GitHub actions workflow dispatch button. | ||
# It runs the -profile 'test' on AWS batch | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
TOWER_ACCESS_TOKEN: ${{ secrets.AWS_TOWER_TOKEN }} | ||
AWS_JOB_DEFINITION: ${{ secrets.AWS_JOB_DEFINITION }} | ||
AWS_JOB_QUEUE: ${{ secrets.AWS_JOB_QUEUE }} | ||
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | ||
|
||
jobs: | ||
run-awstest: | ||
run-tower: | ||
name: Run AWS tests | ||
if: github.repository == 'nf-core/rnaseq' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Miniconda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
- name: Launch workflow via tower | ||
uses: nf-core/tower-action@master | ||
|
||
with: | ||
auto-update-conda: true | ||
python-version: 3.7 | ||
- name: Install awscli | ||
run: conda install -c conda-forge awscli | ||
- name: Start AWS batch job | ||
run: | | ||
aws batch submit-job \ | ||
--region eu-west-1 \ | ||
--job-name nf-core-rnaseq \ | ||
--job-queue $AWS_JOB_QUEUE \ | ||
--job-definition $AWS_JOB_DEFINITION \ | ||
--container-overrides '{"command": ["nf-core/rnaseq", "-r '"${GITHUB_SHA}"' -profile test --outdir s3://'"${AWS_S3_BUCKET}"'/rnaseq/results-'"${GITHUB_SHA}"' -w s3://'"${AWS_S3_BUCKET}"'/rnaseq/work-'"${GITHUB_SHA}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}' | ||
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }} | ||
bearer_token: ${{ secrets.TOWER_BEARER_TOKEN }} | ||
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }} | ||
pipeline: ${{ github.repository }} | ||
revision: ${{ github.sha }} | ||
workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/rnaseq/work-${{ github.sha }} | ||
parameters: | | ||
{ | ||
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/rnaseq/results-${{ github.sha }}" | ||
} | ||
profiles: '[ "test", "aws_tower" ]' |
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 |
---|---|---|
|
@@ -3,7 +3,6 @@ work/ | |
data/ | ||
results/ | ||
.DS_Store | ||
tests/ | ||
testing/ | ||
testing* | ||
*.pyc |
This file was deleted.
Oops, something went wrong.
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,8 @@ | ||
lint: | ||
files_unchanged: | ||
- .markdownlint.yml | ||
- assets/email_template.html | ||
- assets/email_template.txt | ||
- bin/scrape_software_versions.py | ||
- lib/NfcoreTemplate.groovy | ||
- assets/multiqc_config.yaml |
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
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,55 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
import re | ||
import argparse | ||
|
||
def __get_arguments(args=None): | ||
__description__ = "Scan annotations file for biotypes and append the corresponding transcript_biotype field to gene file entries" | ||
__Epilog__ = "Example usage: python add_biotype.py <ANNOTATION_GTF> <REFERENCE_GFF>" | ||
|
||
parser = argparse.ArgumentParser(description=__description__, epilog=__Epilog__) | ||
parser.add_argument("ANNOTATION_GTF", type=str, help="annotation file") | ||
parser.add_argument("REFERENCE_GFF", type=str, help="reference genes file") | ||
return parser.parse_args(args) | ||
|
||
def add_biotype(annotation_gtf, reference_gff): | ||
""" | ||
This function assigns the transcript biotype to the de novo transcripts | ||
of the annotation file if already present in the reference annotation | ||
This script is adapted from the FAANG/analysis-TAGADA pipeline | ||
""" | ||
|
||
args = __get_arguments() | ||
biotypes = {} | ||
|
||
with open(annotation_gtf) as annot_fh: | ||
for line in annot_fh: | ||
if line.startswith('#'): continue | ||
fields = line.strip().split('\t') | ||
if fields[2] != "transcript": continue | ||
tId = re.search('transcript_id "([^;]*)";*', fields[8] ) | ||
biotype = re.search('biotype "([^;]*)";*', fields[8] ) | ||
if tId.group(1) not in biotypes: | ||
biotypes[tId.group(1)] = biotype.group(1) | ||
|
||
with open(reference_gff) as genes_fh: | ||
for line in genes_fh: | ||
line = line.strip('\n') | ||
fields = line.split('\t') | ||
if not fields[0].startswith('#') and fields[2] != "gene": | ||
tId = re.search('transcript_id "([^;]*)";*', fields[8] ) | ||
if tId.group(1) in biotypes: | ||
print(line, 'transcript_biotype "{}";'.format(biotypes[tId.group(1)])) | ||
else: | ||
print(line) | ||
else: | ||
print(line) | ||
|
||
def main(args=None): | ||
args = __get_arguments(args) | ||
add_biotype(args.ANNOTATION_GTF, args.REFERENCE_GFF) | ||
|
||
if __name__ == "__main__": | ||
sys.exit(main()) |
Oops, something went wrong.