This is a test version of Biostars. For the public version, visit https://www.biostars.org.
List In List (Python)

Hi, I have list which contains many lists like this:

L=[[['acg'],['att'],['ccc'],['ttt'],['acttcc'],['ggtac'],[['tggt'],['gggg''],['aaaaat'],['ttttttt'],['accgta'],['tgtgta']],[['ccg'],['gtg'],['ccaa'],['gtatc'],['aattgg'],['agtg']]]

I want to convert the items of list to tables

First I take:

['acg'],['att'],['ccc'] and  ['tggt'],['gggg''],['aaaaat'] and [['ccg'],['gtg'],['ccaa']

I apply on each item a function which return an integer , for example if I apply it on ['acg'] it retuen 1 so applying the function on all the list items. It must gives:

array([1,2,3],
[7,8,9],
[13,14,15])

than , I take:

['ttt'],['acttcc'],['ggtac'] and  ['ttttttt'],['accgta'],['tgtgta'] and ['gtatc'],['aattgg'],['agtg']

It must gives:

array([4,5,6],
[10,11,12],
[16,17,18])
list python

Quick! Mention some biological context for this (please) or you'll annoy the hell out of a lot of people and your question might get closed. Better to give people a hint at how lists of lists in python could be used in biology.

0 answers

No answers yet.

Log in to answer this question.