Ich habe diese zwei DAT-Dateien (I zeigen nur die ersten 20 Zeilen für beide):AWK Join zwei Dateien funktioniert nicht
GO:0005509 PDCD6
GO:0004672 CDK1
GO:0005524 CDK1
GO:0005634 CDK1
GO:0005737 CDK1
GO:0006468 CDK1
GO:0005615 SERPINB6
GO:0006629 APOC2
GO:0006869 APOC2
GO:0008047 APOC2
GO:0042627 APOC2
GO:0043085 APOC2
GO:0001932 TADA2L
GO:0003677 TADA2L
GO:0005671 TADA2L
GO:0006357 TADA2L
GO:0007067 TADA2L
GO:0008270 TADA2L
GO:0016573 TADA2L
Und
GO:0000001 mitochondrion inheritance
GO:0000002 mitochondrial genome maintenance
GO:0000003 reproduction
GO:0000005 ribosomal chaperone activity
GO:0000006 high affinity zinc uptake transmembrane transporter activity
GO:0000007 low-affinity zinc ion transmembrane transporter activity
GO:0000008 thioredoxin
GO:0000009 alpha-1,6-mannosyltransferase activity
GO:0000010 trans-hexaprenyltranstransferase activity
GO:0000011 vacuole inheritance
GO:0000012 single strand break repair
GO:0000014 single-stranded DNA specific endodeoxyribonuclease activity
GO:0000015 phosphopyruvate hydratase complex
GO:0000016 lactase activity
GO:0000017 alpha-glucoside transport
GO:0000018 regulation of DNA recombination
GO:0000019 regulation of mitotic recombination
GO:0000020 negative regulation of recombination within rDNA repeats
(...)
Wenn ich versuche, eine machen Beitreten für beide Dateien, ich bekomme nur ein paar Ergebnisse (genau 10). Der vollständige Code ist:
ls *gene_association* | while read file;
do
echo;
echo @@@ File: $file;
echo;
# New file "assoc_specie.txt"
IFS='_' read -r -a array <<< "$file"
SPECIE=${array[2]}
#Filtering comments (!comment...)
cat $file | grep -v '!' > assoc_$SPECIE.txt;
gawk 'BEGIN{OFS="\t";FS="\t"}{print $5, $3}' assoc_$ESPECIE.txt > goTerms_$ESPECIE.dat;
join goTerms_$SPECIE.dat gene_ontology.dat > join.dat
echo
done;
Ich weiß nicht, was ich falsch mache, aber es ist offensichtlich, dass beitreten nicht alle Ergebnisse angezeigt.
Vielen Dank im Voraus
PS: assoc_specie.txt Datei dieses Format (nur zeigt erste Zeile) hat:
UniProtKB A0A024QZ42 PDCD6 GO:0005509 GO_REF:0000002 IEA InterPro:IPR002048 F HCG1985580, isoform CRA_c A0A024QZ42_HUMAN|PDCD6|hCG_1985580 protein taxon:9606 20160312 InterPro
(...)
Ich bin verwirrt. Welche der beiden Beispieldateien ist die 'assoc_ $ SPECIE.txt'? Welches ist die 'gene_ontology.dat'? Beachten Sie, dass 'Join' erfordert, dass die Datendateien in der Reihenfolge des Schlüssels angeordnet sind. Die erste Beispieldatei ist in der ersten Spalte nicht sortiert. –
Bitte fügen Sie die gewünschte Ausgabe für diese Beispieleingabe zu Ihrer Frage hinzu. – Cyrus
Lesen Sie http://unix.stackexchange.com/questions/169716/why-is-using-a-shell-loop-to-process-text-considered-bad-practice und dann das Buch Effective Awk Programming, 4. Ausgabe, von Arnold Robbins. –