Skip to content

Commit

Permalink
script changes
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardsnj committed Dec 8, 2023
1 parent 6c733d0 commit 8fc2487
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/bulkimg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ shift $(($OPTIND - 1))
if [ $VERBOSE -eq 1 ]; then
echo $JAVA -cp "$JAR" $MAIN notation "$NOTATION" display "$DISP" scale "$SCALE" orient "$ORIENT" redend "$REDEND" opaque "$OPAQUE" format "$FORMAT" force "$FORCE" outdir "$OUTDIR" $@ 1>&2
fi
exec $JAVA -cp "$JAR" $MAIN notation "$NOTATION" display "$DISP" scale "$SCALE" orient "$ORIENT" redend "$REDEND" opaque "$OPAQUE" format "$FORMAT" force "$FORCE" outdir "$OUTDIR" $@ 2>/dev/null | egrep -w -v '(org.glycoinfo|DEBUG|GlycanImageCmdline.main|org.eurocarbdb.application.glycanbuilder)'
exec $JAVA -cp "$JAR" $MAIN notation "$NOTATION" display "$DISP" scale "$SCALE" orient "$ORIENT" redend "$REDEND" opaque "$OPAQUE" format "$FORMAT" force "$FORCE" outdir "$OUTDIR" $@ 2>/dev/null | egrep -w -v '(org.glycoinfo|DEBUG|GlycanImageCmdline.main|org.eurocarbdb.application.glycanbuilder|Warning:)'
39 changes: 35 additions & 4 deletions scripts/glycotree_gctconid.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@
for r in csv.DictReader(open(idmapfilename),dialect='excel-tab'):
idmaps[r['Accession']][r['GlycoCTResidueIndex']] = r['CanonicalResidueIndex']

validresidues = set(filter(None,"""
GlcNAc
Glc
Man
Gal
GalNAc
Fuc
Xyl
NeuAc
NeuGc
P
S
Count
""".split()))

def validcomp(comp):
for k,v in comp.items():
if k not in validresidues and v > 0:
return False
return True

def check_idmap(gly1,gly2,idmap):
ids1 = gly1.external_descriptor_ids()
ids2 = gly2.external_descriptor_ids()
Expand All @@ -50,6 +71,13 @@ def iternlinkedaccs():
for acc,strict,resids,linkids in gm.getstruct('GGM','001001'):
if acc in seen:
continue
gly = gtc.getGlycan(acc)
if not gly or gly.repeated():
continue
comp = gly.iupac_composition(aggregate_basecomposition=False)
# print(comp)
if not validcomp(comp):
continue
yield acc
seen.add(acc)

Expand All @@ -65,11 +93,14 @@ def iterolinkedaccs():
for acc,strict,resids,linkids in gm.getstruct('GGM',olc):
if acc in seen:
continue
gly = gtc.getGlycan(acc)
if not gly or gly.repeated():
continue
comp = gly.iupac_composition(aggregate_basecomposition=False)
print(comp)
if not validcomp(comp):
continue
if olc in "001034":
gly = gtc.getGlycan(acc)
if not gly or gly.repeated():
continue
comp = gly.iupac_composition()
if comp['Count'] not in (1,2):
continue
if comp['Count'] == 2 and comp['NeuAc'] != 1:
Expand Down

0 comments on commit 8fc2487

Please sign in to comment.