Hello Pierre:
I tried the following file conversion:
cat coherent.fa | paste -d@ - - - - | sed 's$|C[0-9]\+_$\t$g' | sed 's$|Q[0-9]\+_$\t$g' | sed 's$|rank$\t|rank$g' > test.txt
paste -d@ - - - - will combine 4 lines of text into one, separated by @. I will use the @ as a placeholder to reconstruct the original coherent.fa format.
The sed commands will search for the count data and the quality data and only keep the numbers, separated by a tab. The resulting file can be opened in a spreadsheet programme (as long as the number of rows does not exceeed the programme's capabilities), with some manipulation I can add the values from two, three, four columns as required by the number of files belonging to one individual and add columns with required |C#_ and |Q#_ values (create a set of new columns, get the sum of values from individual columns). To be able to delete the original columns of C and Q values, I copy the file, paste it in a new sheet keeping only the numerical values (thus not the formulas that refer to other cells). Then the original columns can be deleted without disruptinig the new C and Q values.
After that I can delete the tabs to get one uninterrupted line of data and use the "@" to separate it back into 4 lines with "upper-path" and "lower-path" and the corresponding allele sequences. (sed 's/\t//g' test.csv | sed 's/@/\n/g' > test2.csv) Then do the genotyping.
I am not sure whether taking a weighted average of the Q values would be the best thing to do (INT((C1Q1)+(C2Q2)++...) / total count) but since the genotyping script does only use the count values, it does not really matter for my purpose.
This went quite well, except for one entry where the contig length was 8800 on one side and about 7500 on the other... there the sequence had been wrapped over two lines and the genotyping script did not accept that. Luckily it was only one occurrence... so I could correct that in a text editor.
With Perl or Python script it would probably be easier to sum the counts and calculate qualities without going to a spreadsheet programme... but I am essentially Perl and Python agnostic.
I still think though that "virtually concatenating" the files would be better as the Q values and "Rank" will be calculated more properly.
run_discoSnp.sh -g ######### -p output_file_prefix -r1 "file1 file2" -r2 "file3 file4 file5" -r3 "file6 fle7" ...
Internally the programme somehow renames the sequence entries for each file and only outputs "C1_", "C2_" with corresponding "Q1_" and "Q2_"? So reading through from file1 into file2 might not cause problems for the calculations, I suppose?