Hello everyone,
I am trying to run MUMmer codes in a list of files for which I tried to make a for loop, but this does not seem to work. Below are my codes and list of files:
#list of files
T161_AssemblyScaffolds_Repeatmasked.fasta
T31_AssemblyScaffolds_Repeatmasked.fasta
T299_AssemblyScaffolds_Repeatmasked.fasta
T2_AssemblyScaffolds_Repeatmasked.fasta
ls *__AssemblyScaffolds_Repeatmasked.fasta > file_list.txt
files=`cat file_list.txt`
for var in $files
do
promer --mum --prefix=Nechacore-${var} 77-13-4_masked_core.fasta ${var}_AssemblyScaffolds_Repeatmasked.fasta
delta-filter -g Nechacore-${var}.delta > Nechacore-${var}-filtered.delta
show-coords -rcl Nechacore-${var}-filtered.delta > Nechacore-${var}.coords
I want the output files with the following names for each different input files in each steps but that's not what I am getting
Nechacore-T2.delta
Nechacore-T2-filtered.delta
Nechacore-T2.coords
Nechacore-T161.delta
.., etc
Please help!! Thanks
then what is the output you are getting?
I would personally already change the loop to this:
I am getting the delta file as below
instead of
but after this step, I am getting an error :
I think I am doing something wrong while calling the variable. The output files I am getting are also empty. When I run the code for individual files the code is alright. It runs perfectly, so the problem is definitely with the loop I made.
what would the cmdline for such a single job look like?
the file names you are getting is exactly what has been asked for in the loop. In the loop you request to use the whole filename of the input files for the new file names. Since the last part is always the same you need to create a new var, in the loop, that contains the T2 T16 and so. Something like this :
this will remove everything from the first _ onward and thus retain only the T parts
see my post above to figure out what the difference is with what you do in the loop
(top tip btw: including an echo of $var in your loop is a good idea to see what you're working with)
I am sorry, since I am quite new to these for loops I could not figure out how and where to put this new variable in my code so that I can get the desired output. Could you please help!!