Insert ETS record

Creating ETS record for a new deposition may fail e.g. because of a network problem between the deposition server and the ETS database server.

BMRB-only aka post-CD&A ADIT-NMR

ETS record is inserted by python script localbin/insert_nmrif_to_ets.py in the ADIT-NMR instalation tree. The script will log the SQL command for inserting the ETS record in the file etslog.txt in the session directory.

etslog.txt should look something like

insert into entrylog (depnum,status,submission_date,contact_person1,last_updated,molecular_system,restart_id,author_email,accession_date,source,bmrbnum,contact_person2,submit_
type,nmr_dep_code,onhold_status,lit_search_required) values (nextval('depnum_seq'),'nd','2016-09-13','Iwakawa, Naoto','2016-09-13','monomeric SOD1','2016-09-13.deposit-beta.bm
rb.wisc.edu.80.57021710','iwakawa.naoto.46w@st.kyoto-u.ac.jp,morimoto@moleng.kyoto-u.ac.jp','2016-09-13','Author',26893,'Morimoto, Daichi','Dep','5Q0R8Z8','2016-09-13','N') ;
insert into logtable (logid,depnum,actdesc,newstatus,statuslevel,logdate,login) values (nextval('logid_seq'),currval('depnum_seq'),'NEW DEPOSITION','nd',1,now(),'')
/usr/bin/psql ets.bmrb.wisc.edu ETS ets
psql: could not connect to server: Connection timed out
        Is the server running on host "ets.bmrb.wisc.edu" and accepting
        TCP/IP connections on port 5432?
psql returned 2

(in this case ADIT-NMR failed to connect to ETS database server, perhaps due to a network problem.)

Copy it to a different file, e.g. ets.sh and edit it to read

psql -h ets.bmrb.wisc.edu -d ETS -U ets -c "insert into entrylog (depnum,status,submission_date,contact_person1,last_updated,molecular_system,restart_id,author_email,accession_date,source,bmrbnum,contact_person2,submit_type,nmr_dep_code,onhold_status,lit_search_required) values (nextval('depnum_seq'),'nd','2016-09-13','Iwakawa, Naoto','2016-09-13','monomeric SOD1','2016-09-13.deposit-beta.bmrb.wisc.edu.80.57021710','iwakawa.naoto.46w@st.kyoto-u.ac.jp,morimoto@moleng.kyoto-u.ac.jp','2016-09-13','Author',26893,'Morimoto, Daichi','Dep','5Q0R8Z8','2016-09-13','N') ; insert into logtable (logid,depnum,actdesc,newstatus,statuslevel,logdate,login) values (nextval('logid_seq'),currval('depnum_seq'),'NEW DEPOSITION','nd',1,now(),'')"

Note that you need to add double quotes around the entire sql statement (while individual values inside the statements must be in single quotes, except the BMRB ID). Also note that both e-mails (if there are two) are one value.

Then run it:

sh ets.sh

Successful result should be something like

INSERT 531104151 1

"joint" ADIT-NMR

Insertion is done by a Java program, top of etslog.txt file looks like this:

my args are: nmrif_name=bmr5Q0Q9R0.nmrif is_locked=none_locked dep_ID=5Q0Q9R0 rcsbNum=RCSB104589 pdbId=2N9G bmrbAccNum=25905 restartID=2015-11-06.deposit.bmrb.wisc.edu.80.89232156 nsy=new

=== The lines below will fail if the update already worked, silently ignore the error and
=== continue anyway if it happens.
==== This is the command being run: ========================
java ets_cmd url=jdbc:postgresql://torpedo.bmrb.wisc.edu/ETS ets/ets4prod aditnmr/ETS$defaulT new_dep --MOLECULAR_SYSTEM ? --CONTACT_PERSON1 yang, xiao --CONTACT_PERSON2 ?, ? --NMR_DEP_CODE 5Q0Q9R0 --ONHOLD_STATUS WWPDB --AUTHOR_EMAIL yang5580@mail.ustc.edu.cn,? --BMRBNUM 25905 --RCSB_CODE RCSB104589 --PDB_CODE 2N9G --RESTART_ID 2015-11-06.deposit.bmrb.wisc.edu.80.89232156
============================================================                                                                                                                                         

******** WARNING ********
                                                                                                                                                                               
System defaults will be used instead of the properties file.

Cannot read configuration file /raid/adit/.ETS.properties (No such file or directory)
Cannot connect to this database.

org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
...

Take the “This is the command being run” line, copy into another file e.g. ets.sh and edit it to look like this:

java -cp "/raid/adit/aditnmr-req-shifts/javalib/ets.jar:/raid/adit/aditnmr-req-shifts/javalib/postgresql-8.0-311.jdbc3.jar" ets_cmd url='jdbc:postgresql://torpedo.bmrb.wisc.edu/ETS' 'ets/ets4prod' 'aditnmr/ETS$defaulT' new_dep --MOLECULAR_SYSTEM '?' --CONTACT_PERSON1 'yang, xiao' --CONTACT_PERSON2 '?, ?' --NMR_DEP_CODE 5Q0Q9R0 --ONHOLD_STATUS WWPDB --AUTHOR_EMAIL 'yang5580@mail.ustc.edu.cn,?' --BMRBNUM 25905 --RCSB_CODE RCSB104589 --PDB_CODE 2N9G --RESTART_ID '2015-11-06.deposit.bmrb.wisc.edu.80.89232156' 

Then run it:

sh ets.sh

The output should end with

Command completed successfully.
Login