more features to align interleaved files (with parallelization) - #25
more features to align interleaved files (with parallelization)#25DiegoBrambilla wants to merge 16 commits into
Conversation
erikrikarddaniel
left a comment
There was a problem hiding this comment.
-
I think it would be better to keep the python scripts in their own repositories, but document how to install in relevant makefiles.
-
I have refrained from using the .fasta file ending in rules in preference for the more specific .fna, .faa and some others. I think it would be good to stick to that and change .fasta to .fna.
-
It looks like you deleted the header from
makefile.diamond. There are more things in the diff for this one that looks like large chunks of things were deleted. -
You can't have an
includein a library makefile, especially not one which has an absolute path! Instead, write in the documentation that one has to include some other makefiles as well. -
I'm not sure about having a diamond_bacmet and diamond_deeparg. It would fit better to have a
makefile.bacmetandmakefile.deepargfor fetching data etc. and then just continue with specifying the path to databases in individualMakefiles. (Here, you're also including makefiles...)
…met and makefile.trimgalore
|
Hi,
The python scripts were removed from
Done. Now rules and targets in makefile.bacmet and makefile.deeparg refer to either .fna or .faa files
The aforementioned changes were reverted. Now the header of makefile.diamond is back to the way it was before.
Done.
makefile.bacmet and makefile.deeparg have been created. They have rules to fetch databases and parse DIAMOND output. |
erikrikarddaniel
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
Many targets are duplicated and could go into e.g. makefile.misc and, I think, makefile.diamond. You can, and should, include more than one makefile and it's nothing wrong with requiring inclusion of a dependent makefile.
| NCBI_BLAST_DB_PATH = YOU NEED TO SET THE NCBI_BLAST_DB_PATH VARIABLE (see makefile.blast) | ||
| BLAST_PROTEIN_DB = YOU NEED TO SET THE BLAST_PROTEIN_DB VARIABLE (see makefile.blast) | ||
| BLAST_NUCLEOTIDE_DB = YOU NEED TO SET THE BLAST_NUCLEOTIDE_DB VARIABLE (see makefile.blast) | ||
| BLAST_NUCLEOTIDE_DB_PATH = . |
There was a problem hiding this comment.
Why do you need this (and the next)? Can't you use the BLAST_NUCLEOTIDE_DB variable?
There was a problem hiding this comment.
Agreed, will change accordingly.
| # *** Targets *** | ||
|
|
||
| # UNTESTED and assumes you've also included makefile.misc that can convert a fastq.gz to an fna: | ||
| all_mega.blastn6s: $(subst .fna,.mega.blastn6.tsv.gz,$(wildcard *.fastq.gz)) |
There was a problem hiding this comment.
This will not work. You're trying to replace .fna in a list of files that ends with .fastq.gz.
There was a problem hiding this comment.
Good point, better stick with $(wildcard *.fna)
| # BLASTn-specific macros | ||
| # | ||
| # *Don't redefine!* | ||
| MAKECALL_BLASTn_VERSION = echo "$$(date +"%Y%m%d %H:%M:%S"): $@ was made with $$(blastn -version|grep 'blastn:')" > $@.makecall |
There was a problem hiding this comment.
I prefer only capitals in macro names.
There was a problem hiding this comment.
I understand, consistency is important.
| # full path of the database file, without the ".dmnd" suffix. | ||
| DIAMOND_DB = | ||
|
|
||
| # deeparg.py specific macro: define minimum a.a. alignemnt length threshold |
There was a problem hiding this comment.
Could be documented better.
| # IMPORTANT: databases are updated recurrently, so always check the availability of the http | ||
|
|
||
| # Download HTTPS URL for the bacmet.py script, necessary for the downstream analyses | ||
| HTTPS = https://gist.github.com/08ab264f0ea127cc242d99bc3844c743.git |
There was a problem hiding this comment.
It would be better if you could package your script in Conda and instruct users to install that way. See e.g. https://github.com/erikrikarddaniel/hmmrank
There was a problem hiding this comment.
Agreed, but I am short on time right now. Can we make the github gists do for the time being, please?
There was a problem hiding this comment.
Fine, but I'd prefer if the instructions are to put it in ~/bin rather than in the working directory.
There was a problem hiding this comment.
No problem, thanks.
| bowtie2 $(BOWTIE_ALIGN_OPTS) -x $(BOWTIE_INDEX) -1 $(word 1,$^) -2 $(word 2,$^) 2> $@.err | samtools view -Sb | samtools sort > $@ | ||
| @echo "`date +"%Y%m%d %H:%M:%S"`: DONE" >> $@.makecall | ||
|
|
||
| %.pe.bowtie2.sorted.bam: %.r1.fastq %.r2.fastq |
There was a problem hiding this comment.
You might have a use case for this, but I avoid working with unzipped fastq files as much as I can and since bowtie2 handles zipped files, I don't see why one needs this. Better to zip any files that are not zipped before starting the mapping.
There was a problem hiding this comment.
Rules and targets with unzipped FASTQ files will be removed.
| ALENGTH = 37.5 | ||
|
|
||
| # Set this to suffixes corresponding to the types of files you wish to fetch with some | ||
| # of the t$(DIAMOND_DB)ets. |
| # and link the file "features.fasta" into the DIAMOND work directory | ||
| # 2) install deeparg, e.g. via conda | ||
| # $ conda create -n deeparg_env python=2.7.18 | ||
| # $ source activate deeparg_env |
There was a problem hiding this comment.
Should be conda activate deeparg_env.
| # *** misc targets *** | ||
|
|
||
| # compress all .fastq files in the work directory. | ||
| compress_all_fastqs: $(subst .fastq,.fastq.gz, $(wildcard *.fastq)) |
There was a problem hiding this comment.
Typical target for makefile.misc.
There was a problem hiding this comment.
Removed: better left on makefile.misc
| # Dependencies will automatically be unzipped if not present in unzipped format | ||
| # thanks to the pattern above. Unzipped files will be deleted after | ||
| # interleaving. | ||
| interleave_all_fastq.gzs: $(subst .R1.fastq.gz,.intlv.fastq.gz,$(wildcard *.R1.fastq.gz)) |
There was a problem hiding this comment.
Also makefile.misc. (Also in another file I reviewed above. Define every target only once.)
There was a problem hiding this comment.
Same as above reply.
Hi,
There was no feature in makefile.diamond for running DIAMOND against specific databases other than RefSeq, so I created two new makefiles, makefile.diamond_bacmet and makefile.diamond_deeparg.
I have also developed rules in makefile.bowtie2 and makefile.diamond to run interleaved files.
Alsio, I have added separate recipies in makefile.blast to run both BLASTn and BLASTx with GNU Parallel.
Please check if changes conform to your standards.