<jupyter_start><jupyter_text>Make table of Jellyfish k-mers in Proch and Pelag genomes<jupyter_code>import pandas as pd
import glob
import skbio
import re<jupyter_output>/Users/luke/anaconda/envs/qiime190/lib/python2.7/site-packages/pandas/computation/__init__.py:19: UserWarning: The installed version of numexpr 2.4.4 is not supported in pandas and will be not be used

  UserWarning)<jupyter_text>Dataframe of merged jellyfish results<jupyter_code>mer = 6
path_glob = '/Users/luke/singlecell/jellyfish/*_%smer.fa' % mer
df = pd.DataFrame(index=[x.split('/')[-1] for x in glob.glob(path_glob)])
for path in glob.glob(path_glob):
    fasta = skbio.io.read(path, format='fasta')
    for x in fasta:
        kmer = str(x)
        count = x.metadata['id']
        df.loc[path.split('/')[-1], kmer] = count
df.fillna(0, inplace=True)
df.index = [re.sub('_%smer.fa' % mer, '', x) for x in df.index]<jupyter_output><empty_output><jupyter_text>Genome metadata (want to know if it's Prochlorococcus or Pelagibacter)<jupyter_code>df_genome_metadata = pd.read_csv('/Users/luke/singlecell/notebooks/genome_metadata.tsv', sep='\t', index_col=0)<jupyter_output><empty_output><jupyter_text>Write combined and individual files for Prochlorococcus and Pelagibacter<jupyter_code>code_pro = list(df_genome_metadata['jellyfish'][(df_genome_metadata['genus'] == 'Prochlorococcus') & df_genome_metadata['jellyfish'].notnull()])
df_pro = df.loc[code_pro]
df_pro.to_csv('/Users/luke/singlecell/notebooks/jellyfish_proch_%smer.csv' % mer)
code_pel = list(df_genome_metadata['jellyfish'][(df_genome_metadata['genus'] == 'Pelagibacter') & df_genome_metadata['jellyfish'].notnull()])
df_pel = df.loc[code_pel]
df_pel.to_csv('/Users/luke/singlecell/notebooks/jellyfish_pelag_%smer.csv' % mer)
code_combined = list(df_genome_metadata['jellyfish'][((df_genome_metadata['genus'] == 'Pelagibacter') | (df_genome_metadata['genus'] == 'Prochlorococcus')) & df_genome_metadata['jellyfish'].notnull()])
df_combined = df.loc[code_combined]
df_combined.to_csv('/Users/luke/singlecell/notebooks/jellyfish_combined_%smer.csv' % mer)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14649081488459728, 'fraction_numerical': 0.00706547338671691, 'mean_word_length': 7.0150943396226415, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '145684', 'license': 'MIT', 'n_tokens_mistral': 830, 'n_tokens_neox': 790, 'n_words': 125, 'path': 'red-sea-single-cell-genomes/code/singlecell_jellyfish.ipynb', 'repo_name': 'cuttlefishh/papers', 'size': '2123'}