Hi all!
I have hundreds of .csv files with the same dimensions and the same column 1 (gene_name). I would like to do an inner_join in the terminal (linux command line) in order to have a single matrix.
This is the .csv files head SRR*_matrix_tpm.csv
==> SRR5488793_matrix_tpm.csv <==
gene_name SRR5488793
NM_001042449.1 3752.38
NM_001043315.1 0
NM_001043316.2 1.31546
NM_001043358.1 0
NM_001043359.1 9.34679
NM_001043360.1 0.459982
NM_001043361.1 4.52898
NM_001043362.1 396.222
NM_001043363.1 101.929
==> SRR5488794_matrix_tpm.csv <==
gene_name SRR5488794
NM_001042449.1 5352.09
NM_001043315.1 0.0205977
NM_001043316.2 3.23229
NM_001043358.1 0
NM_001043359.1 15.0625
NM_001043360.1 0.833219
NM_001043361.1 11.0039
NM_001043362.1 147.638
NM_001043363.1 22.1844
==> SRR5570692_matrix_tpm.csv <==
gene_name SRR5570692
NM_001042449.1 5155.04
NM_001043315.1 1.74624
NM_001043316.2 18.6743
NM_001043358.1 0
NM_001043359.1 81.4916
NM_001043360.1 0
NM_001043361.1 16.1719
NM_001043362.1 34391.8
NM_001043363.1 3315.22
I would like to have something like this:
==> matrix.csv <==
gene_name SRR5488793 SRR5488794 SRR5570692
NM_001042449.1 3752.38 5352.09 5155.04
NM_001043315.1 0,0 0.0205977 174624,0
NM_001043316.2 131546,0 323229,0 186743,0
NM_001043358.1 0,0 0,0 0,0
NM_001043359.1 934679,0 150625,0 814916,0
NM_001043360.1 0.459982 0.833219 0,0
NM_001043361.1 452898,0 110039,0 161719,0
NM_001043362.1 396222,0 147638,0 34391.8
NM_001043363.1 101929,0 221844,0 3315.22
Many thanks!
Hi mark.ziemann, many thanks for your reply. However, I have
hundreds of SRR*.csv files
. Is it the same code? Many thanks!I've edited my original post with another solution
Thanks a lot Mark Zeimann! All the best my friend!