Skip to content

Instantly share code, notes, and snippets.

@Test public void foo() throws Exception {
IsotopeFactory ifac = Isotopes.getInstance();
IIsotope c = ifac.getMajorIsotope("C");
IIsotope h = ifac.getMajorIsotope("H");
IIsotope o = ifac.getMajorIsotope("O");
IIsotope br79 = ifac.getMajorIsotope("Br");
IIsotope br81 = ifac.getIsotope("Br", 81);
MolecularFormulaRange mfRange = new MolecularFormulaRange();
import chemaxon.struc.Molecule;
import chemaxon.util.MolHandler;
import gov.nih.ncgc.algo.graph.VFLib2;
import gov.nih.ncgc.descriptor.MolecularFramework;
import gov.nih.ncgc.util.ChemUtil;
import gov.nih.ncgc.util.MolStandardizer;
import org.apache.commons.dbcp2.BasicDataSource;
import java.io.BufferedReader;
import java.io.FileReader;
import chemaxon.struc.Molecule;
import chemaxon.util.MolHandler;
import gov.nih.ncgc.algo.graph.VFLib2;
import gov.nih.ncgc.descriptor.MolecularFramework;
import gov.nih.ncgc.util.ChemUtil;
import gov.nih.ncgc.util.MolStandardizer;
import org.apache.commons.dbcp2.BasicDataSource;
import java.io.BufferedReader;
import java.io.FileReader;
library(dplyr)
library(rcdk)
all_form <- expand.grid(C=1:5, N=0:5, O=0:5, H=0:50)
all_form <- all_form %>%
mutate(formula = paste0('C',C,'N',N,'O',O,'H',H))
system.time(valid <- sapply(all_form$formula, function(x) isvalid.formula(get.formula(x))))
table(valid)
function setjdk() {
if [ $# -ne 0 ]; then
removeFromPath '/System/Library/Frameworks/JavaVM.framework/Home/bin'
if [ -n "${JAVA_HOME+x}" ]; then
removeFromPath $JAVA_HOME
fi
export JAVA_HOME=`/usr/libexec/java_home -v $@`
export PATH=$JAVA_HOME/bin:$PATH
fi
}
public void testSA() throws FileNotFoundException, CDKException {
FileInputStream fis = new FileInputStream("/Users/guhar/tmp/after_alignment.sdf");
MDLV2000Reader reader = new MDLV2000Reader(fis, Mode.STRICT);
IAtomContainer after = reader.read(new AtomContainer());
fis = new FileInputStream("/Users/guhar/tmp/before_alignment.sdf");
reader = new MDLV2000Reader(fis, Mode.STRICT);
IAtomContainer before = reader.read(new AtomContainer());
System.out.println(before.getProperty(CDKConstants.TITLE));
System.out.println(after.getProperty(CDKConstants.TITLE));
byte[] molbytes = su.getFile(new ObjectId(oid));
ByteArrayInputStream bais = new ByteArrayInputStream(molbytes);
try {
MolImporter importer = new MolImporter(bais);
List<Molecule> mols = new ArrayList<Molecule>();
while (true) {
Molecule m = importer.read();
if (m == null) break;
m.setProperty("uuid", sub.getUserUuid());
m.setProperty("pi_name", sub.getPiName());
library(ncgchts)
library(ggplot2)
library(RColorBrewer)
library(stringr)
data(sample.info)
con <- get.connection('hts', 'ncgc', 'probedb')
curve.order <- c(-1.1, -1.2, -2.1, -2.2, -1.3, -2.3, -1.4, -2.4, 1.1, 1.2, 2.1, 2.2, 1.3, 2.3, 1.4, 2.4, -3.0, 3.0, 4.0, 5.0)
protos <- c('s-levens-topo-HCT116-1', 's-levens-topo-mutant-1')
curves <- lapply(protos, function(p) {
"","C01","C02","C03","C04","C05","C06"
"1071",86.38420065,79.07808678,29.7117183,103.41587423,111.10614753,8.63011858
"10800",44.29501369,6.54247662,68.01638855,66.75177262,3.54032541,68.38830847
"10919",57.126174675,5.58139873,82.08353185,31.667684375,7.363592625,92.422583695
"11200",46.98399506,7.95712996,112.22964622,31.28326229,4.60511211,129.60868594
"1268",33.44880143,5.153618,79.30898798,29.60511291,32.73451976,94.67177589
"1352",19.37561449,0.17288331,78.88568485,9.14411316,24.0009678,78.18529926
"148",3.33528891,1.60941952,78.13779848,3.15238557,4.96052261,71.51730085
"1636",12.37098707,0.907317765,88.355246405,10.96153091,4.049607285,78.91513506
"1644",97.88520438,32.16221987,80.88268546,99.14777684,29.55725639,90.61186379
C01 C02 C03 C04 C05 C06
4193 58.52690209 19.79238528 105.52763504 94.95405256 31.71595781 118.67890655
1644 97.88520438 32.16221987 80.88268546 99.14777684 29.55725639 90.61186379
598 2.87791536 1.25763403 49.85402356 2.28738267 2.77951966 65.14421558
7153 10.14441154 13.59621158 57.16808301 7.37447958 2.33377616 77.48738463
4790 22.75508944 42.99521409 109.28704983 36.73099591 34.4355488 89.54434147
6774 4.09136397 7.24804356 108.45800573 40.2471083 4.58565529 106.56955414
3156 78.35995401 54.8259949 114.3780661 87.60616517 37.04524797 104.79968629
5916 23.89803961 9.43186629 84.96080843 13.23830152 22.095928 68.91517787
2932 27.36320561 1.68586442 112.55169248 21.23236686 3.56942032 77.29558595