【发布时间】:2017-07-07 08:21:51
【问题描述】:
我有一些需要分析的fastaq 文件。主要问题是我目前使用的分析工具仅接受 ACTG 作为核苷酸,而不接受 IUPAC 代码中的其他命名法(R、W 等)。
我编写了这段代码来改变特定的核苷酸:
awk '{
split($2,a,"") ;
str="" ;
for (n in a) {nucleotide=a[n]} ;
if (nucleotide~/[ACTG]/) {str=str""nucleotide}
else {
if (nucleotide~/[RWMV]/) {str=str""A}
else {
if (nucleotide~/[YD]/) {str=str""C}
else {
if (nucleotide~/[SKN]/) {str=str""G}
else {str=str""T}
}
}
}
}' | head
它正在工作,但速度非常慢。你知道更有效的方法吗?
非常感谢!
【问题讨论】:
-
for (n in a) {nucleotide=a[n]} ;不好用 -
您的预期输出是什么?和示例输入?
-
你不会对最后的变量
str做任何事情 -
我知道
fastq格式,但不知道fastaq格式 -
如果您需要 fastaq 专家的帮助,您可能走在正确的轨道上,但如果您一般需要 awk 专家的帮助,那么将可以帮助您的人限制在那些也知道任何事情的人fastaq 可能不是您最好的方法。 edit 你的问题包括简洁、可测试的样本输入和预期输出,如果你想大大增加能够帮助你的人的数量,不要假设我们对你的特定领域有任何了解。
The main issue is that .. only accept ACTG as nucleotides and not the rest of nomenclatures in the IUPAC code不邀请一般帮助。
标签: linux string awk bioinformatics