Search Results

Search: Posts Made By: shen
2,841
Posted By vgersh99
nawk 'FNR==1{h=$0;next} {a[$1]=($1 in a)?a[$1]...
nawk 'FNR==1{h=$0;next} {a[$1]=($1 in a)?a[$1] "||" $2:$2}END{print h;for(i in a) print i,a[i]}' OFS='\t' myFile
2,841
Posted By bartus11
Try: awk...
Try: awk 'NR==1{h=$0;next}{a[$1]=a[$1]"||"$2}END{print h;for (i in a){sub("^\\|\\|","",a[i]);print i,a[i]}}' file
2,841
Posted By vgersh99
Strange. given your sample input, I got: ...
Strange. given your sample input, I got:

Transcript Name GO
POPTR_0004s22390.1 12897
POPTR_0015s05840.1 13455
POPTR_0001s11490.1
POPTR_0016s06290.1 98654...
8,728
Posted By ctsgnb
Then just remove POPTR_1855s00200 and give a try...
Then just remove POPTR_1855s00200 and give a try to :
grep \.1\| infilenawk -v RS=">" -v FS="" '/\.1\|/' infilenawk -v RS=">" -v FS="" '/\.1\|/{printf "%s",$0}' infile
8,728
Posted By ctsgnb
my code output does not contain *.3 stuff, only...
my code output does not contain *.3 stuff, only *.1 :
(i based my test on the sample you gave)

# cat tst
>POPTR_1446s00200.20|PACid:18205974...
8,728
Posted By Franklin52
Try this: awk 'f && /^>POP/{f=0}...
Try this:
awk 'f && /^>POP/{f=0} /^>POP.*\.1\|/{f=1}f' file
8,728
Posted By rdcwayx
All in one. awk...
All in one.

awk '/mRNA/{split($2,a,"=");print;next}/gene/{print;next}{sub(/=.*/,"="a[2],$1)}1 ' FS=\; OFS=\; infile
8,728
Posted By ctsgnb
while IFS='=;' read a b c d e; do if [[ "$b" !=...
while IFS='=;' read a b c d e; do if [[ "$b" != "$d" ]]; then [[ "$f" == 1 ]] && v=$d; f=0; b=$v; else f=1; fi; [[ ! -z $e ]] && d="$d;$e"; echo "$a=$b;$c=$d"; done <tst# cat tst
sscaffold_1 ...
8,728
Posted By rdcwayx
awk...
awk '/gene/{split($(NF-1),a,"=");print;next}{sub(/=.*/,"="a[2]".1",$1)}1 ' FS=\; OFS=\; infile
8,728
Posted By ctsgnb
while IFS='=;' read a b c d e do [[ "$b" ==...
while IFS='=;' read a b c d e
do [[ "$b" == "$d" ]] && v=$b || b=$v
[[ ! -z $e ]] && d="$d;$e"
echo "$a=$b;$c=$d"
done <infile# cat tst
sscaffold_1 phytozome6 gene 12632 13612 . ...
Showing results 1 to 10 of 10

 
All times are GMT -4. The time now is 01:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy