示例#1
0
 def create_list_user(self):
     lister = Lister(self.list_of_items.copy())
     lister.exec_()
     self.list_of_items = lister.user_list_list.copy()
     self.user_list.clear()
     for el in self.list_of_items:
         self.user_list.addItem(el)
     cost = 0
     cost_data = json.loads(open("data/products2.json").read())
     for el in self.list_of_items:
         cost += cost_data[el]
     for el in self.deleted_items:
         cost += cost_data[el]
     if cost <= 9999:
         self.label_2.setText("Итого: {}₽".format(cost))
     else:
         self.label_2.setText("Итого: 9999₽+".format(cost))
def consumer(input_q):
    while True:
        item = input_q.get()
        hash = Lister.get_hash(item)
        # hash = get_hash(item)
        print('{} => {}'.format(hash, item))
        input_q.task_done()
    return None
示例#3
0
    def __init__(self, m_file='', path='/', genbank_update=False):
        self.M_file = m_file
        # Always make sure this file name is correct
        self.what = Lister('MAFV3.1.csv')
        self.GenBank_update = genbank_update

        path_list = where.path_list_make(where.VERT_MAM, where.NCBI_DATA)
        print('path_list: ', path_list)
        if path == '/':
            self.path, t = self.db2gbk_mkdir(where.VALLENDER_DATA, path_list,
                                             self.GenBank_update)
        else:
            self.path = path
            print('self.path: ', self.path)
示例#4
0
    def __init__(self, path='/', fasta_update=False):
        self.FASTA_update = fasta_update
        # Always make sure this file name is correct
        self.what = Lister('MAFV3.1.csv')
        self.org_list = self.what.org_list
        self.gene_list = self.what.gene_list

        if os.path.isdir(where.GB_FASTA + '/Vallender_Data') is False:
            os.mkdir(where.GB_FASTA + '/Vallender_Data')
        self.feature_list = [
            'CDS',
            'Protein',
            'Misc_Features',
            'Other']  # Feature list for directory tree
        path_list = where.path_list_make(where.VERT_MAM, where.NCBI_DATA)
        print('path_list: ', path_list)
        if path == '/':
            self.path, t = self.db2fasta_mkdir(
                where.GB_FASTA + '/Vallender_Data', path_list, self.FASTA_update)
        else:
            self.path = path
            print('self.path: ', self.path)
示例#5
0
import os
from BioSQL import BioSeqDatabase
from dir_mana import dir_mana
from lister import Lister

home = os.getcwd()
project = "GPCR-Orthologs-Project"
user = "******"
where = dir_mana(home, project)
# Use lister() class here so that we can easily access our Master RNA Accession File
what = Lister('MAFV3.1.csv')  # Always make sure this file name is correct

# genes = '%s' % genes.r_repr().rstrip('\n')
arg_string1 = 'gene'
db_list = []
for gene in what.master_gene_list:
    arg_string1 += (' %s' % gene)
arg_string2 = 'org'
for org in what.org_list:
    arg_string2 += (' %s' % org)
for file in os.listdir('/srv/shiny-server/GPCR-Orthologs-Project/CODE/1_Databases/Vallender Data/'):
    if '.db' in str(file):
        db_list.append(file)
for db_name in db_list:
    server = BioSeqDatabase.open_database(driver='sqlite3', db='/srv/shiny-server/GPCR-Orthologs-Project/CODE/1_Databases/Vallender Data/%s' % db_name)
    for sub_db_name in server.keys():
        db = server[sub_db_name]
        Accession = str(what.A_Get1['HTR1A']['Homo_sapiens'])
        Accession, Sup, Version = Accession.partition('.')
        Accession = Accession.upper()
        try:
示例#6
0
from dir_mana import dir_mana
from lister import Lister

# Get child process information
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
machine = platform.node()

# Initialize project based functions and variables
home = os.getcwd()
project = "GPCR-Orthologs-Project"
user = "******"
where = dir_mana(home, project)
what = Lister('MAFV3.1.csv')

# Initialize the files and variables used to upload the proper database files
log_file = ''
# THe download list contains 8 lists with file names  e.g. [[list1], [list2]....[list8]]
temp_file = 'temp_file.txt'  # A JSON file (keys: 'logfile'; 'downloadlist', 'db_name', 'key)
# (values: 'file'; list of lists;, 'refseq-release-vertebrate-mammalian', 'vertebrate-mammalian)
temp_file_flag = True
process_number = rank
home = home + '/CODE/1_Databases/NCBI_Data/refseq/release/multiprocessing'

# Try to open the temporary file.  The same file is trying to be accessed by 8 different jobs
# TODO-ROB Make 8 different files with 0-7 labeled
while temp_file_flag is True:
    try:
        with open(home + '/' + temp_file, mode='r',