Open JonPitsch314 opened 1 year ago
Thank you very much for the testing and the thorough explanation of the changes and improvements. Do you mind submit a pull request, so that we can merge it into master branch? On the tophat vs hisat issue, I think an argument that lets users to specify the aligner would be preferred to maintain backward compatibility and comparability with old versions.
You're welcome! I'm happy to create a pull request for this. Also, I agree with you about making an argument that lets users specify the aligner that they want to use. I will test a few ideas to create that, then submit the pull request.
Hello, first of all, I want to thank you for all the work that put into creating this tool. I found a few issues when I tried to install and run it based on the instructions in the Github, so I thought I would submit an issue to show what I found. Please let me know what you think.
Creating Environment
Download Fasta Index
Modified the file paths in the download_fasta_index_v0.0.2.py script:
Changed line 36 from:
To:
This change was needed because the previous gunzip command was trying to operate on a non-existent file, 'gencode.v29.2wayconspseudos.gtf.gz'.
Changed line 55 from:
To:
This change was needed because the previous gunzip command was trying to access a file in a non-existent directory, 'GRCh37_mapping'.
Now the following command should run without issue:
Create Hisat2 Reference Genome Index files
It is recommended by the TopHat creators to use Hisat2, as it will work with Python 3 and newer versions of the tools used in the VirTect.py script.
To create a hisat2 reference genome index, load the virtect environment and run the following command:
The above command will create a series of files with the .ht2 file extension. A screenshot of mine looks like this:
Modifying the VirTect.py Script
There were only a few changes that needed to be made to work with Python 3.
There were some print statements that needed parentheses.
The tophat command needed to be replaced with a command that worked with hisat2:
def alignment(): cmd1='hisat2 -f -x '+hisat_index+' -1 reads_fasta_1.fa -2 reads_fasta_2.fa -S '+out+'/unmapped.sam -p '+n_thread+'' print ('Running ', cmd1) os.system(cmd1) alignment()
However, hisat2 takes fasta files as an input instead of fastq files. So I chose to write a function that precedes the alignment function:
Adding an argument for the hisat2 index file:
You'll see in my version of the VirTect script that I commented out the arguments for -ucsc_gene and -index:
I changed the usage message to show the correct arguments needed to run the script:
The original command caused an error in the second awk command in this string. There was a missing \ from the command. I changed the samtools depth command to the following:
I added the missing \ after the %s %d-d string.
My version of the download_fasta_index_v0.0.2.py script
import os import sys import argparse
prog_name = 'download_fasta_index_v0.0.2'
def main():
if name == 'main': main()
My Version of the VirTect.py script
import sys import argparse import os import subprocess import os.path import fileinput
prog="VirTect.py"
usage = """Usage: %prog[-h] -1 read1.fastq -2 read2.fastq -o The output name for alignement -ucsc_gene gtf -index index files -index_vir virus fasta -hisat_index human genome index [-t Number of threads, default: 8]"""
def main():
if name == 'main': main()