nanls / M2BI-db-project

1 stars 1 forks source link

probleme de keywords #56

Closed nanls closed 7 years ago

nanls commented 7 years ago

OperationalError: (sqlite3.OperationalError) table pdb_file has no column named keywords [SQL: u'INSERT INTO pdb_file (id, seq, keywords, name, head, deposition_date, release_date, structure_method, resolution, structure_reference, journal_reference, author, compound) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'] [parameters: ('1kxy', 'KVFGRCELAAAMKRHGLNNYRGYSLGNWVCAAKFESNFNTQATNRNTDGSTDYGILQINSRWWCNDGRTPGSRNLCNIPCSALLSSDITASVNCAKKIVSDGNGMNAWVAWRNRCKGTDVQAWIRGCRL', 'hydrolase, glycosidase, electrostatic interaction, helix, hen lysozyme, stability', ' analysis of the stabilization of hen lysozyme with the helix dipole and charged side chains', 'hydrolase', '1996-11-22', '1997-11-26', 'x-ray diffraction', 1.79, '[]', 'h.motoshima,s.mine,k.masumoto,y.abe,h.iwashita, y.hashimoto,y.chijiiwa,t.ueda,t.imoto analysis of the stabilization of hen lysozyme by helix macrodipole and charged side chain interaction. j.biochem.(tokyo) v. 121 1076 1997 issn 0021-924x 9354379 ', 'H.Motoshima,T.Ohmura,T.Ueda,T.Imoto', "{'1': {'chain': 'a', 'misc': '', 'molecule': 'lysozyme', 'ec_number': '3.2.1.17', 'engineered': 'yes', 'ec': '3.2.1.17', 'mutation': 'yes'}}")]

@jecarvaill : est ce que tu as bien la bonne version de la bdd ?

$ sqlite3 data.db 
> .schema pdb_file

ca te donne quoi ?

jecarvaill commented 7 years ago

en effet il manque les champs dans la bdd sqlite3.

jecarvaill commented 7 years ago

Tu as refait ton script de génération de bdd ?

NicolasBourassin commented 7 years ago

Sur la branche save-data-in-db (comme sur la branche develop) les attributs de la table PDBFile sont :

    id = db.Column(db.String(4), primary_key=True)
    seq = db.Column(db.Text)
    resolution = db.Column(db.Text)
    keywords = db.Column(db.Text)
    name = db.Column(db.Text)
    head = db.Column(db.Text)
    deposition_date = db.Column(db.Text)
    release_date = db.Column(db.Text)
    structure_method = db.Column(db.Text)
    resolution = db.Column(db.Float)
    structure_reference = db.Column(db.Text)
    journal_reference = db.Column(db.Text)
    author = db.Column(db.Text)
    compound  = db.Column(db.Text)
    chains = db.relationship('Chain', backref='pdb', lazy='dynamic')
    annotations = db.relationship('Annotation', backref='pdb', lazy='dynamic')
    angles = db.relationship('Angle', backref='pdb', lazy='dynamic')

Note : keywords est bien présent.

Du coup je ne vois pas quels champs manqueraient à la bdd pour stocker les infos. Tu vas bien les chercher dans PDBFile et pas dans Chains ?

nanls commented 7 years ago

@jecarvaill : non, mais on a touché au model -> supprime l'ancienne bdd, regenere là, et relance l'application. (et verifie que le nouveau shema a bien été pris en compte).

jecarvaill commented 7 years ago

déjà fait mais ça me génère sans les champs. Et oui je suis bien sur PDFile et non sur Chain.

Ok j'ai refait un git pull, apparemment il l'avait as pris en compte. Je ne sais pas pourquoi. Mais là c'est good.

2017-04-12 15:08 GMT+02:00 Athénaïs Vaginay notifications@github.com:

@jecarvaill https://github.com/jecarvaill : non, mais on a touché au model -> supprime l'ancienne bdd, regenere là, et relance l'application.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Athenais/M2BI-db-project/issues/56#issuecomment-293569921, or mute the thread https://github.com/notifications/unsubscribe-auth/AYsi5McsFI1xcy_iv62cZb7nc99ESLYrks5rvMzUgaJpZM4M7WUn .

nanls commented 7 years ago

ok, tant mieux. :) j'ai eu un coup de flip à la première partie, et j'ai apprécié l'édition. ^^

jecarvaill commented 7 years ago

sqlite> select * from pdb_file ...> ; xy_1|KVFGRCELAAAMKRHGLNNYRGYSLGNWVCAAKFESNFNTQATNRNTDGSTDYGILQINSRWWCNDGRTPGSRNLCNIPCSALLSSDITASVNCAKKIVSDGNGMNAWVAWRNRCKGTDVQAWIRGCRL|hydrolase, glycosidase, electrostatic interaction, helix, hen lysozyme, stability| analysis of the stabilization of hen lysozyme with the helix dipole and charged side chains|hydrolase|1996-11-22|1997-11-26|x-ray diffraction|1.79|[]|h.motoshima,s.mine,k.masumoto,y.abe,h.iwashita, y.hashimoto,y.chijiiwa,t.ueda,t.imoto analysis of the stabilization of hen lysozyme by helix macrodipole and charged side chain interaction. j.biochem.(tokyo) v. 121 1076 1997 issn 0021-924x 9354379 |H.Motoshima,T.Ohmura,T.Ueda,T.Imoto|{'1': {'chain': 'a', 'misc': '', 'molecule': 'lysozyme', 'ec_number': '3.2.1.17', 'engineered': 'yes', 'ec': '3.2.1.17', 'mutation': 'yes'}}