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
# https://stackoverflow.com/questions/21542753/dir-without-built-in-methods | |
def vdir(obj): | |
return [x for x in dir(obj) if not x.startswith('__')] | |
#Test | |
#test2 | |
print(1) |
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
print(11) | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
<div id="viewport" style="width:100%; height:100%;"></div> |
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
import os | |
import sys | |
from shutil import copyfile | |
""" | |
Fix the atom types names in a acpype generated itp file for Gromacs. | |
Input: *_GMX.itp *_NEW.pdb eg: NAD_H_GMX.itp NAD_H_NEW.pdb | |
to run: python itpsort2.py NAD_H_GMX.itp NAD_H_NEW.pdb | |
""" | |
file = sys.argv[1] #"NAD_H_GMX.itp" | |
pdb = sys.argv[2] # "NAD_H_NEW.pdb" |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
#NCBI data extraction using Eutilities and Python | |
# More details "https://www.ncbi.nlm.nih.gov/books/NBK25498/ | |
__author__ = "Bakary N'tji Diallo" | |
__email__ = "[email protected]" | |
import requests |
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
# -*- coding: utf-8 -*- | |
# Protein Translation Problem: Translate an RNA string into an amino acid string. | |
# Input: An RNA string Pattern and the array GeneticCode. | |
# Output: The translation of Pattern into an amino acid string Peptide. | |
from collections import defaultdict | |
import itertools | |
genetic_code = {'ACC': 'T', 'GCA': 'A', 'AAG': 'K', 'AAA': 'K', 'GUU': 'V', 'AAC': 'N', 'AGG': 'R', | |
'UGG': 'W', 'GUC': 'V', 'AGC': 'S', 'ACA': 'T', 'AGA': 'R', 'AAU': 'N', 'ACU': 'T', |
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
# Protein Translation Problem: Translate an RNA string into an amino acid string. | |
# Input: An RNA string Pattern and the array GeneticCode. | |
# Output: The translation of Pattern into an amino acid string Peptide. | |
from collections import defaultdict | |
import itertools | |
Genetic_code = {'ACC': 'T', 'GCA': 'A', 'AAG': 'K', 'AAA': 'K', 'GUU': 'V', 'AAC': 'N', 'AGG': 'R', | |
'UGG': 'W', 'GUC': 'V', 'AGC': 'S', 'ACA': 'T', 'AGA': 'R', 'AAU': 'N', 'ACU': 'T', | |
'GUG': 'V', 'CAC': 'H', 'ACG': 'T', 'AGU': 'S', 'CCA': 'P', 'CAA': 'Q', 'CCC': 'P', | |
'UGU': 'C', 'GGU': 'G', 'UCU': 'S', 'GCG': 'A', 'CGA': 'R', 'CAG': 'Q', 'CGC': 'R', |
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
# -*- coding: utf-8 -*- | |
# CODE CHALLENGE: Solve the String Composition Problem. | |
# Input: An integer k and a string Text. | |
# Output: Compositionk(Text) (the k-mers can be provided in any order). | |
def StringKmerCompo(sequence, kmerlenght): | |
compo,i =[],0 | |
while i < (len(sequence)-kmerlenght+1): | |
compo.append(sequence[i:i+kmerlenght]) | |
i+=1 |
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
# scrip that print the number of time a word appear in a text | |
#import the text file and read it | |
test = open("test list of word r.txt", 'r'); | |
text = test.read(); | |
#build a list of the words in the text | |
listOfWord = text.split() | |
# dictionnay that will contain the words |