Commit ef444114c1af6e564a274bf36cb2c2bc77745b3a

Authored by Jean-Michel Garant
1 parent f9e35d41

update pandas compatibility, add sample.fas

Showing 2 changed files with 18 additions and 3 deletions   Show diff stats
sample.fas 0 → 100644
... ... @@ -0,0 +1,15 @@
  1 +>Telomeric repeat-containing RNA (TERRA)
  2 +UUAGGGUUAGGGUUAGGGUUAGGGUUAGGGUUAGGGUUAGGGUUAGGG
  3 +>NM_000633 chr18:63318709-63318733
  4 +GGGGGCCGUGGGGUGGGAGCUGGGG
  5 +>hg38_refGene_NM_002524.4 range=chr1:114716863-114716883 5'pad=0 3'pad=0 strand=- repeatMasking=none
  6 +UGUGGGAGGGGCGGGUCUGGG
  7 +>ENST00000265340 chr5:135028038:135028073:-1
  8 +AGCGGGCAGUGCGGGCCUGGCGGGAGGUGGGGGAGG
  9 +>Spinach aptamer (false negative example)
  10 +GGACGCGACCGAAAUGGUGAAGGACGGGUCCAGUGCGAAACACGCACUGU
  11 +UGAGUAGAGUGUGAGCUCCGUAACUGGUCGCGUC
  12 +>String of U (T are internally converted to U)
  13 +UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
  14 +>String of C (sequences are case insensitive)
  15 +cccccccccccccccccCCCCCCCCCCCCCCCCCCCCCCCCCCccccccccccccccccc
... ...
utils.py
... ... @@ -330,12 +330,12 @@ def kmer_transfo(
330 330 "sed "s/U/T/g" | "\
331 331 "jellyfish count -m 3 -s 100 -o /dev/stdout /dev/stdin | "\
332 332 "jellyfish dump -ct /dev/stdin | "\
333   - "sed "s/T/U/g"'%(df.ix[row,sequence_column].
  333 + "sed "s/T/U/g"'%(df.loc[row,sequence_column].
334 334 upper().replace('T','U')), shell=True).split('\n')[:-1]:
335 335 di_nt_cnts[line_out.split('\t')[0]] = int(line_out.split('\t')[1])
336 336 else:
337 337 di_nt_lst = regex.findall(
338   - '.{%d}'%depth,df.ix[row,sequence_column].upper().replace('T','U'),
  338 + '.{%d}'%depth,df.loc[row,sequence_column].upper().replace('T','U'),
339 339 overlapped=True)
340 340 di_nt_cnts = Counter(di_nt_lst)
341 341 if len([di_nt_cnts[x] for x in di_nt_cnts]) > 4**depth:
... ... @@ -345,6 +345,6 @@ def kmer_transfo(
345 345 di_nt_freqs = [(str(di_nt), float(di_nt_cnts[di_nt])/total_di_nt)
346 346 for di_nt in di_nt_cnts if "N" not in di_nt]
347 347 for di_ntd, freq in di_nt_freqs:
348   - df.ix[row,di_ntd] = freq
  348 + df.loc[row,di_ntd] = freq
349 349 verbosify(verbose, "Kmer transformed")
350 350 return df
... ...