Entering edit mode
3.6 years ago
Bioinfonext
▴
460
Hi,
I have got two tab demilated files; count.txt and metadata.txt. I would like to renmae the count.txt header based on the metadata.txt 5th Column (SampleType). Could anyone please suggest how I can do it by using R or unix command?
Count .txt
Root-T1 Root-T2 Root-T3 Root-T4
8e60d301122d7aa359eb6b0b00f37f62 10.99317665 9.83612554 10.0140148 12.93594085
16c306238059e7942361b356cb1fe8e0 8.536081053 9.830638671 9.823501073 11.76397582
bfad6370d28182cc6304844e9bec7fb6 5.39148115 4.246835906 2.154775982 7.668303753
97aecc1f35cc1f50db507ad71dd22367 1.683437866 11.0066574 2.743835676 7.427173277
85ecffe953eb7a94dd582cd4437a79d8 3.075677166 2.785500037 2.487627557 3.343912342
4e6308265ca4d8eaf48d14ddedf31033 1.661037976 1.671665813 2.645294092 3.017676992
Metadata.txt
Treatment Batch Compartment SampleType
Root-T1 T1 FIRST Root Irrigated
Root-T2 T1 FIRST Root Irrigated
Root-T3 T1 FIRST Root Irrigated
Root-T4 T1 FIRST Root Irrigated
Many thanks,
thanks Pierre,
For 4th column, this command working perfectly, but for 5th column result file look like below;
If I open the result file based on 5th column with vi command it like this; I am not sure how it got ^M character.
it works perfectly after I have corrected the metadata file by using below command.
Many thanks
Is it also possible to arrange all Irrigated column together and then rainfed?
Many thanks