Issues with bash script and seqkit and awk
1
0
Entering edit mode
2.9 years ago

If 10 trimmed fastq .gz files are in directory I want to extract the one file which has least gc content guanine cytosine content

I tried using seqkit and awk command but for the didn't find know to get 1 from 10 files which have least gc content in its sequences

Command for picking up the file with certain circumstance as minimum gc content??????????? ?????????????

Secondly Merge logfiles of all samples in trimmed fastqc files into 1 tabular form file using bash script commands ???????????‽??????????

Await assistance

display • 1.1k views
ADD COMMENT
0
Entering edit mode

I want detailed illustrative details and explanation as I am very beginner And I don't know substitution in already formed commands

As $ seqkit grep -s -R 1:30 -i -r -p GCTGG

Is there something near this command To find1 trimmed file of 10 trimmed but which has minimum gc content Merge 20 files into 1 files of trimmed logfiles of the sampleSite??????

ADD REPLY
0
Entering edit mode

You posted two queries in your first OP and you are asking a totally different query here. Please post different post for each query with background information, code you have used, errors and posting example input and output would be helpful.

with pyfastx, datamash and sed:

$ pyfastx stat <input_directory>/*.gz | sed 's/\s\+/\t/g' | datamash -fsH min 4 

sometimes, there can be a tie, in that case try this to publish the entire table:

$ pyfastx stat <input_directory>/*.gz | sed 's/\s\+/\t/g' | csvtk -t sort -k 4 -D $'\t'

.

Secondly Merge logfiles of all samples in trimmed fastqc files into 1 tabular form file using 
bash script commands ?

What program are you using for generating log files? post example log file.

ADD REPLY
0
Entering edit mode
2.9 years ago
 find DIRECTORY -type f -name "*.fq.gz" | while read F; do gunzip -c "${F}" | paste - - - - | cut -f 2 | awk -v F=$F '{N+=length($0);gsub(/[^GCSgcs]/,"");M+=length($0);} END{printf("%s %f\n",F,M/N);}' ; done | sort -t ' ' -k2,2g | cut -d ' ' -f 1 | head -n1
ADD COMMENT

Login before adding your answer.

Traffic: 1692 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6