
import string, sys
import h5py
import numpy as np

hF = h5py.File(sys.argv[1])

group = "mm10"
indptr = hF[group +"/indptr"]
indices = hF[group + "/indices"]
data = hF[group + "/data"]
genes = hF[group + "/genes"]
gene_names = hF[group + "/gene_names"]
barcodes = hF[group + "/barcodes"]
shape = hF[group + "/shape"]
rowN = shape[0]
colN = shape[1]
counter_indptr_size = rowN

fout = open("features.tsv",'w')

for i in range (0, len(genes)):
    fout.write("{} {} {}".format(i, genes[i], gene_names[i]))


import string, sys
import h5py
import numpy as np

hF = h5py.File(sys.argv[1])

group = "mm10"
indptr = hF[group +"/indptr"]
indices = hF[group + "/indices"]
data = hF[group + "/data"]
genes = hF[group + "/genes"]
gene_names = hF[group + "/gene_names"]
barcodes = hF[group + "/barcodes"]
shape = hF[group + "/shape"]
rowN = shape[0]
colN = shape[1]
counter_indptr_size = rowN

fout = open("features.tsv",'w')
fout.write("index\tfeature\tfeature_name\n")
for i in range (0, len(genes)):
    fout.write("{}\t{}\t{}\n".format(i, genes[i], gene_names[i]))

Make a tsv instead of a long string
Make a tsv instead of a long string

  
  import string, sys
  import h5py
  import numpy as np
  
  hF = h5py.File(sys.argv[1])
  
  group = "mm10"
  indptr = hF[group +"/indptr"]
  indices = hF[group + "/indices"]
  data = hF[group + "/data"]
  genes = hF[group + "/genes"]
  gene_names = hF[group + "/gene_names"]
  barcodes = hF[group + "/barcodes"]
  shape = hF[group + "/shape"]
  rowN = shape[0]
  colN = shape[1]
  counter_indptr_size = rowN
  
  fout = open("features.tsv",'w')
+ fout.write("index\tfeature\tfeature_name\n")
+ for i in range (0, len(genes)):
+     fout.write("{}\t{}\t{}\n".format(i, genes[i], gene_names[i]))
  
- for i in range (0, len(genes)):
-     fout.write("{} {} {}".format(i, genes[i], gene_names[i]))
- 
Make a tsv instead of a long string
## Code Before:

import string, sys
import h5py
import numpy as np

hF = h5py.File(sys.argv[1])

group = "mm10"
indptr = hF[group +"/indptr"]
indices = hF[group + "/indices"]
data = hF[group + "/data"]
genes = hF[group + "/genes"]
gene_names = hF[group + "/gene_names"]
barcodes = hF[group + "/barcodes"]
shape = hF[group + "/shape"]
rowN = shape[0]
colN = shape[1]
counter_indptr_size = rowN

fout = open("features.tsv",'w')

for i in range (0, len(genes)):
    fout.write("{} {} {}".format(i, genes[i], gene_names[i]))

## Instruction:
Make a tsv instead of a long string
## Code After:

import string, sys
import h5py
import numpy as np

hF = h5py.File(sys.argv[1])

group = "mm10"
indptr = hF[group +"/indptr"]
indices = hF[group + "/indices"]
data = hF[group + "/data"]
genes = hF[group + "/genes"]
gene_names = hF[group + "/gene_names"]
barcodes = hF[group + "/barcodes"]
shape = hF[group + "/shape"]
rowN = shape[0]
colN = shape[1]
counter_indptr_size = rowN

fout = open("features.tsv",'w')
fout.write("index\tfeature\tfeature_name\n")
for i in range (0, len(genes)):
    fout.write("{}\t{}\t{}\n".format(i, genes[i], gene_names[i]))
