Created
June 5, 2017 23:33
-
-
Save marcoscastro/5b1a4ae580dd9e51429cdea49b30e674 to your computer and use it in GitHub Desktop.
Codigo bioinfo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arquivo = [] | |
| with open('arquivoteste.csv') as arq: | |
| linhas = arq.readlines() | |
| for linha in linhas: | |
| coluna = linha.split(',') | |
| qcov = float(coluna[9]) * 100.0 | |
| pident = float(coluna[2]) | |
| if qcov >= 80.0 and pident >= 80.0: | |
| print(linha) | |
| arquivo.append(linha) | |
| resultado_linhas = [] | |
| with open('ensembl34.fa') as arq: | |
| linhas = arq.readlines() | |
| tam_linhas = len(linhas) | |
| for cada_linha in arquivo: | |
| cada_coluna = cada_linha.split(',') | |
| for i in range(tam_linhas): | |
| if '>' in linhas[i]: | |
| linha = linhas[i].replace('>', '').replace('\n', '') | |
| busca = linha.split(' ')[0] | |
| if cada_coluna[0] == busca: | |
| cada_coluna[0] = linha | |
| print(linha) | |
| arquivo.append(linha) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment