I have a file with this list:
100 101 102 103
What I want to do is replace all 0 with A, 1 with C, 2 with G, 3 with T. So we hope to get
CAA CAC CAG CAT
You yourself worked out the answer. Simply:
tr 0123 ACGT <input_file >output_file
or
echo 2033010 | tr 0123 ACGT
Here:
perl -p -e 'tr/0123/ACGT/'
Verification:
$ perl -p -e 'tr/0123/ACGT/' <~/input CAA CAC CAG CAT
:
sed 'y/0123/ACGT/' file
$ echo 3210 | tr 0123 ACGT TGCA
- , tr 1:1 . , , 0 A, 1 C, 2 G, 3 - T.
tr
$ awk -vFS="" 'BEGIN{_["1"]="C";_["2"]="G";_["3"]="T";_["0"]="A"}{for(i=1;i<=NF;i++){printf _[$i]}print ""}' file CAA CAC CAG CAT
Source: https://habr.com/ru/post/1742048/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1742043/eclipse-cdt-how-to-map-linux-paths-to-windows-paths&usg=ALkJrhj3SGZRrlEnzVczKHam62x_JME8EgGetting window style - c ++Error Lifecycle and Release Suggestions - release-managementI REFUSE hate MySQL (help build the query) - sqlIs it possible to refer to 'this' when initializing a field? - javaConstructor and installation design - javaUnicode-encoded UICF-16 - c ++How do I create or appoint a delegate? - objective-cRelease date set via EWS is incorrect in popup reminder - c #Error in Mono Compiler: files in libraries or applications with multiple files should start with a namespace or module declaration - f #All Articles