michaelkyu / ddot

Toolkit for constructing, analyzing, and visualizing data-driven ontologies
MIT License
19 stars 21 forks source link

CalculateFDR failed to write the FDRs output #9

Open Clarararaara opened 2 years ago

Clarararaara commented 2 years ago

I got this error sed: -e expression #1, char 5: unknown command: `'after all the iterations are done, and then the FDRs output is blank. I figured that there may be something wrong with writing the final outputs. Then I found that the error is from the line 47-51 in the CalculateFDR function: for i in $(seq 0 $(($NUM_ITER - 1)) ) do END_OF_HEADER=$(grep -n Matched $RESULTS_DIR/rand_files/alignment_"$i" | sed 's/:.*//'); sed "1,$END_OF_HEADER""d" $RESULTS_DIR/rand_files/alignment_"$i" | sort -r -n -k 3 | cut -f 1,2,3 > $RESULTS_DIR/rand_files/alignment_without_descendents_$i done

This loop looks for the line number where 'Matched' occurs in the file and gathers information after that line. However, for some of my alignment files, there are 2 'Matched' in the file, which leads to an error when generating "alignment_without_descendents" file. I am curious what causes the additional 'Matched' to appear in the file? Thanks