Skip to content

Instantly share code, notes, and snippets.

@sxv
Created November 18, 2017 08:30
Show Gist options
  • Save sxv/2ce375ba6a4fb1ade1c6234188f8414e to your computer and use it in GitHub Desktop.
Save sxv/2ce375ba6a4fb1ade1c6234188f8414e to your computer and use it in GitHub Desktop.
take ENS gene id and gene name and append col[2:] from input files
import sys
rows = []
for line in open('gene_names.csv'):
a,b,c = line.replace('\n','').split(',')
rows.append([a,c])
for file in sys.argv[1:]:
for i, line in enumerate(open(file)):
rows[i] += line.replace('\n','').split(',')[2:]
for row in rows:
print ','.join(row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment