Skip to content

Commit

Permalink
Merge pull request #28 from yyoshiaki/v2.0.2
Browse files Browse the repository at this point in the history
V2.0.2
  • Loading branch information
yyoshiaki authored Jul 24, 2023
2 parents 1378095 + 9d1c989 commit e4f95cc
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 14 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ wrapper/*
!wrapper/scattermap.py
.vscode/settings.json
._.DS_Store
.vscode/launch.json
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# VIRTUS2 : VIRal Transcript Usage Sensor v2.0.1 <img src="https://github.com/yyoshiaki/VIRTUS/raw/master/img/VIRTUS.jpg" width="20%" align="right" />
# VIRTUS2 : VIRal Transcript Usage Sensor v2.0.2 <img src="https://github.com/yyoshiaki/VIRTUS/raw/master/img/VIRTUS.jpg" width="20%" align="right" />

**!!Note : We updated VIRTUS to version2. In this version, we removed the gene quantification step by Salmon and single virus mode, and added coverage on viral genomes to the result to focus on virus-wide exploration. If you want to use the single virus mode, visit [https://github.com/yyoshiaki/VIRTUS](https://github.com/yyoshiaki/VIRTUS)**

Expand Down Expand Up @@ -318,6 +318,7 @@ usage: VIRTUS_wrapper.py [-h] \
[--fastq] \
[--figsize FIGSIZE] \
[--th_cov TH_COV] [--th_rate TH_RATE] \
[--singularity] \
input_path
positional arguments:
Expand All @@ -337,6 +338,7 @@ optional arguments:
--figsize FIGSIZE (default:6,6)
--th_cov TH_COV threshold of max viral coverage to plot, test (default:10)
--th_rate TH_RATE threshold of max rate virus/human to plot, test (default:0.0001)
--singularity run with singularity (default:False)
```
example
```
Expand Down
2 changes: 1 addition & 1 deletion tool/kz_filter/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM conda/miniconda3
USER root

RUN conda install -y -c eclarke komplexity
RUN conda install -y -c eclarke komplexity==0.3.6
17 changes: 17 additions & 0 deletions workflow/VIRTUS.PE.localref.job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
fastq1:
class: File
path: >-
../test/ERR3240275/ERR3240275_1.fastq.gz
fastq2:
class: File
path: >-
../test/ERR3240275/ERR3240275_2.fastq.gz
genomeDir_human:
class: Directory
path: ../test/STAR_index_human_localref
genomeDir_virus:
class: Directory
path: ../test/STAR_index_virus_localref
nthreads: 40
outFileNamePrefix_human: human
filename_output: VIRTUS.localref.output.tsv
13 changes: 13 additions & 0 deletions workflow/VIRTUS.SE.localref.job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fastq:
class: File
path: >-
../test/SRR8315715/SRR8315715_2.fastq.gz
genomeDir_human:
class: Directory
path: ../test/STAR_index_human_localref
genomeDir_virus:
class: Directory
path: ../test/STAR_index_virus_localref
nthreads: 40
outFileNamePrefix_human: human
filename_output: VIRTUS.localref.output.tsv
122 changes: 122 additions & 0 deletions workflow/createindex_localref.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
#!/usr/bin/env cwltool

class: Workflow
cwlVersion: v1.0
id: createindex
doc: VIRTUS v2.0
label: CreateIndex_localref
$namespaces:
sbg: 'https://www.sevenbridges.com/'
inputs:
- id: f_virus
type: File
'sbg:x': -1123.8369140625
'sbg:y': -782.5
- id: dir_name_STAR_virus
type: string
'sbg:x': -1126.984130859375
'sbg:y': -518.8207397460938
- id: f_human
type: File
'sbg:x': -1102
'sbg:y': -167
- id: dir_name_STAR_human
type: string
'sbg:x': -1108
'sbg:y': 115
- id: runThreadN
type: int?
'sbg:x': -1116
'sbg:y': -318
outputs:
- id: starIndex_virus
outputSource:
- star_index_virus/starIndex
type: Directory
'sbg:x': -486.8369140625
'sbg:y': -606.5
- id: starIndex_human
outputSource:
- star_index_human/starIndex
type: Directory
'sbg:x': -491.496826171875
'sbg:y': -166.5
steps:
- id: star_index_virus
in:
- id: genomeDir
source: mkdir_virus/created_directory
- id: genomeFastaFiles
source: f_virus
- id: runThreadN
source: runThreadN
- id: genomeSAindexNbases
default: 12
out:
- id: starIndex
run: ../tool/star/star_index/star_index.cwl
label: 'STAR genomeGenerate: Generating genome indexes.'
'sbg:x': -709.8369140625
'sbg:y': -605.5
- id: mkdir_virus
in:
- id: dir_name
default: STAR_index_virus
source: dir_name_STAR_virus
out:
- id: created_directory
run: ../tool/mkdir/mkdir.cwl
label: Make directory if not exists
'sbg:x': -937.1593627929688
'sbg:y': -520.8286743164062

- id: star_index_human
in:
- id: genomeDir
source: mkdir_human/created_directory
- id: genomeFastaFiles
source: f_human
- id: runThreadN
source: runThreadN
- id: genomeSAindexNbases
default: 14
out:
- id: starIndex
run: ../tool/star/star_index/star_index.cwl
label: 'STAR genomeGenerate: Generating genome indexes.'
'sbg:x': -709.8369140625
'sbg:y': -605.5

- id: mkdir_human
in:
- id: dir_name
default: STAR_index_human
source: dir_name_STAR_human
out:
- id: created_directory
run: ../tool/mkdir/mkdir.cwl
label: Make directory if not exists
'sbg:x': -937.1593627929688
'sbg:y': -520.8286743164062


# - id: rnaseq_star_index_human
# in:
# - id: runThreadN
# source: runThreadN
# - id: url_genomefasta
# source: url_genomefasta_human
# - id: output_name_genomefasta
# source: output_name_genomefasta_human
# - id: dir_name
# source: dir_name_STAR_human
# - id: genomeSAindexNbases
# default: 14
# out:
# - id: downloaded_genomefasta
# - id: starIndex
# run: rnaseq-star_index/rnaseq-star_index.cwl
# 'sbg:x': -688
# 'sbg:y': -91
requirements:
- class: SubworkflowFeatureRequirement
11 changes: 11 additions & 0 deletions workflow/createindex_localref.job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
dir_name_STAR_virus: STAR_index_virus_localref
dir_name_STAR_human: STAR_index_human_localref
runThreadN: 40
f_virus:
class: File
path: >-
../data/viruses.fasta
f_human:
class: File
path: >-
../test/GRCh38.p13.genome.fa
12 changes: 10 additions & 2 deletions wrapper/VIRTUS_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
parser.add_argument('--figsize', default = '8,3', help='(default:8,3)')
parser.add_argument('--th_cov', default = '10', help='threshold of max viral coverage to plot, test (default:10)')
parser.add_argument('--th_rate', default = '0.0001', help='threshold of max rate virus/human to plot, test (default:0.0001)')
parser.add_argument('--singularity', action = 'store_true', help='run with singularity (default:False)')

args = parser.parse_args()

Expand All @@ -53,6 +54,11 @@
except (ValueError, IndexError):
exit('invalid path to VIRTUS. try to change --VIRTUSDir to the absolute path.')

if args.singularity:
singularity = ' --singularity'
else:
singularity = ''

# %%
list_df_res = []

Expand Down Expand Up @@ -118,6 +124,7 @@
if item["Layout"] =="PE":
VIRTUS_cmd = " ".join([
"cwltool",
singularity,
"--rm-tmpdir",
os.path.join(dir_VIRTUS, "VIRTUS.PE.cwl"),
"--fastq1", '../'+fastq1,
Expand All @@ -131,6 +138,7 @@
elif item["Layout"] =="SE":
VIRTUS_cmd = " ".join([
"cwltool",
singularity,
"--rm-tmpdir",
os.path.join(dir_VIRTUS, "VIRTUS.SE.cwl"),
"--fastq", '../'+fastq,
Expand Down Expand Up @@ -195,8 +203,8 @@

list_index = (set(list(df_rate.index)) & set(list(df_cov.index)))

df_cov = df_cov.loc[list_index]
df_rate = df_rate.loc[list_index]
df_cov = df_cov.reindex(list_index)
df_rate = df_rate.reindex(list_index)

df_cov = df_cov[df_rate.columns]

Expand Down
20 changes: 10 additions & 10 deletions wrapper/summary.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
virus,Ctrl_1_cov,Ctrl_2_cov,Flu_1_cov,Flu_2_cov,Ctrl_1_rate,Ctrl_2_rate,Flu_1_rate,Flu_2_rate,u-value,p-value,FDR
"NC_007360.1_Influenza_A_virus_(A/Goose/Guangdong/1/96(H5N1))_nucleocapsid_protein_(NP)_gene,_complete_cds",7.53994,18.7859,79.0415,52.7796,2.0898752524203576e-08,2.0557772102157603e-07,0.00017833350419595113,5.705166243157474e-05,4.0,0.2452781168067728,0.27253124089641423
"NC_007372.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_2,_complete_sequence",0.0,66.1256,99.5728,99.4874,0.0,7.537849770791118e-07,0.0001770468108072655,0.0001739883316582788,4.0,0.2452781168067728,0.27253124089641423
"NC_001501.1_Moloney_murine_leukemia_virus,_complete_genome",0.0,99.808,0.0,99.808,0.0,0.00010224065325473046,0.0,0.00010721235153450432,2.5,1.0,1.0
"NC_007366.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_4,_complete_sequence",0.0,88.6493,99.546,99.319,0.0,2.7752992337912757e-06,0.001292302052174779,0.001175295727694479,4.0,0.2452781168067728,0.27253124089641423
"NC_004907.1_Influenza_A_virus_(A/Hong_Kong/1073/99(H9N2))_segment_7,_complete_sequence",0.0,26.0488,90.2439,64.7805,0.0,3.08366581532364e-07,0.00017954321592890345,0.00011777617866775727,4.0,0.2452781168067728,0.27253124089641423
"NC_007369.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_5,_complete_sequence",0.0,95.6577,99.4891,99.3614,0.0,3.3920323968560035e-06,0.0015065639948394136,0.0014216742588635755,4.0,0.2452781168067728,0.27253124089641423
"NC_007368.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_6,_complete_sequence",8.86162,95.8419,99.0457,98.9775,2.0898752524203576e-08,1.130677465618668e-06,0.0005835539425968027,0.0005348199832909638,4.0,0.2452781168067728,0.27253124089641423
"NC_007370.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_8,_complete_sequence",0.0,96.0674,98.5393,98.3146,0.0,1.7131476751798e-06,0.0008950437164526317,0.0008666710694272907,4.0,0.2452781168067728,0.27253124089641423
"NC_002016.1_Influenza_A_virus_(A/Puerto_Rico/8/1934(H1N1))_segment_7,_complete_sequence",0.0,31.4508,98.5394,97.7605,0.0,3.4262953503596e-07,0.00010884106382753628,0.0001308585341241699,4.0,0.2452781168067728,0.27253124089641423
"NC_007367.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_7,_complete_sequence",0.0,97.7605,99.3184,99.0263,0.0,2.192829024230144e-06,0.0011559565424916634,0.0011260270173726686,4.0,0.2452781168067728,0.27253124089641423
"NC_007368.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_6,_complete_sequence",8.86162,95.8419,99.0457,98.9775,2.0898752524203576e-08,1.130677465618668e-06,0.0005835539425968,0.0005348199832909,4.0,0.2452781168067728,0.27253124089641423
"NC_002016.1_Influenza_A_virus_(A/Puerto_Rico/8/1934(H1N1))_segment_7,_complete_sequence",0.0,31.4508,98.5394,97.7605,0.0,3.4262953503596e-07,0.0001088410638275,0.0001308585341241,4.0,0.2452781168067728,0.27253124089641423
"NC_007360.1_Influenza_A_virus_(A/Goose/Guangdong/1/96(H5N1))_nucleocapsid_protein_(NP)_gene,_complete_cds",7.53994,18.7859,79.0415,52.7796,2.0898752524203576e-08,2.05577721021576e-07,0.0001783335041959,5.7051662431574736e-05,4.0,0.2452781168067728,0.27253124089641423
"NC_007370.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_8,_complete_sequence",0.0,96.0674,98.5393,98.3146,0.0,1.7131476751798e-06,0.0008950437164526,0.0008666710694272,4.0,0.2452781168067728,0.27253124089641423
"NC_004907.1_Influenza_A_virus_(A/Hong_Kong/1073/99(H9N2))_segment_7,_complete_sequence",0.0,26.0488,90.2439,64.7805,0.0,3.08366581532364e-07,0.0001795432159289,0.0001177761786677,4.0,0.2452781168067728,0.27253124089641423
"NC_007367.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_7,_complete_sequence",0.0,97.7605,99.3184,99.0263,0.0,2.192829024230144e-06,0.0011559565424916,0.0011260270173726,4.0,0.2452781168067728,0.27253124089641423
"NC_007366.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_4,_complete_sequence",0.0,88.6493,99.546,99.319,0.0,2.775299233791276e-06,0.0012923020521747,0.0011752957276944,4.0,0.2452781168067728,0.27253124089641423
"NC_001501.1_Moloney_murine_leukemia_virus,_complete_genome",0.0,99.808,0.0,99.808,0.0,0.0001022406532547,0.0,0.0001072123515345,2.5,1.0,1.0
"NC_007369.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_5,_complete_sequence",0.0,95.6577,99.4891,99.3614,0.0,3.392032396856004e-06,0.0015065639948394,0.0014216742588635,4.0,0.2452781168067728,0.27253124089641423
"NC_007372.1_Influenza_A_virus_(A/New_York/392/2004(H3N2))_segment_2,_complete_sequence",0.0,66.1256,99.5728,99.4874,0.0,7.537849770791119e-07,0.0001770468108072,0.0001739883316582,4.0,0.2452781168067728,0.27253124089641423

0 comments on commit e4f95cc

Please sign in to comment.