Newer
Older
DatabaseEntrySource src = new DatabaseEntrySource();
src.setLocation(true);
if(System.getProperty("ibatis") == null)
dao = new JdbcDAO(src.getLocation(), src.getPfield());
else
dao = new IBatisDAO(src.getPfield());
List schemas = new Vector();
schemas.add(args[1]);
featureList.add(dao.getFeatureByUniqueName(args[0], "polypeptide"));
int fmin = feature.getFeatureLoc().getFmin().intValue() + 1;
int fmax = feature.getFeatureLoc().getFmax().intValue();
((FeatureProp)(new Vector(feature.getFeatureProps()).get(0))).getCvTerm().getName();
System.out.print(" "+feature.getFeatureLoc().getStrand());
System.out.println(" "+Integer.toString(feature.getFeatureId()));
/* Hashtable synonyms = getAllFeatureSynonyms(dao, null);
Vector syns = (Vector)synonyms.get(new Integer(feature.getId()));
for(int j=0; j<syns.size(); j++)
{
FeatureSynonym alias = (FeatureSynonym)syns.get(j);
System.out.print(" "+alias.getSynonym().getCvterm().getName()+
"="+alias.getSynonym().getName());
}
catch(SQLException sqle)
{
sqle.printStackTrace();
}
catch(RuntimeException re)
{
re.printStackTrace();
}
catch(ConnectException e)
{
e.printStackTrace();
}
public Document getParent()
{
return null;
}
/**
* Find from a list the FeatureLoc with a given srcFeature
* @param locs
* @param srcfeature_id
* @return
*/
public static FeatureLoc getFeatureLoc(List locs, int srcfeature_id)
{
for(int i=0; i<locs.size(); i++)
{
FeatureLoc loc = (FeatureLoc)locs.get(i);
if(loc.getFeatureBySrcFeatureId().getFeatureId() == srcfeature_id)
return loc;
}
return null;
}
public String getSrcFeatureId()
{
return srcFeatureId;
}
private JPasswordField getPfield()
{
return pfield;
}
/**
* Return true if this looks like a single schema postgres
* database
* @return
*/
public boolean isSingleSchema()
{
return singleSchema;
}
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
/**
* Ensure exon featurelocs are in the correct order
*/
class LocationComarator implements Comparator
{
public int compare(Object o1, Object o2)
{
int loc1 = ((FeatureLoc)o1).getFmin().intValue();
int loc2 = ((FeatureLoc)o2).getFmin().intValue();
if(loc2 == loc1)
return 0;
int strand = ((FeatureLoc)o1).getStrand().intValue();
if(strand < 0)
{
if(loc2 > loc1)
return 1;
else
return -1;
}
else
{
if(loc2 > loc1)
return -1;
else
return 1;
}
}
}
class CvTermThread extends Thread
{
private GmodDAO dao;
CvTermThread(final GmodDAO dao)
{
this.dao = dao;
}
public void run()
{
getCvterms(dao);
public void setRange(Range range)
{
this.range = range;
}
public Hashtable getIdFeatureStore()
{
return idFeatureStore;
}
public boolean isLazyFeatureLoad()
{
return lazyFeatureLoad;
}
public void setLazyFeatureLoad(boolean lazyFeatureLoad)
{
this.lazyFeatureLoad = lazyFeatureLoad;
}