Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
2ccd71b0
Commit
2ccd71b0
authored
15 years ago
by
Ian Longden
Browse files
Options
Downloads
Patches
Plain Diff
GOSlim parser
parent
e456a288
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/xref_mapping/XrefParser/GOSlimParser.pm
+76
-0
76 additions, 0 deletions
misc-scripts/xref_mapping/XrefParser/GOSlimParser.pm
with
76 additions
and
0 deletions
misc-scripts/xref_mapping/XrefParser/GOSlimParser.pm
0 → 100644
+
76
−
0
View file @
2ccd71b0
package
XrefParser::
GOSlimParser
;
use
strict
;
use
DBI
;
use
base
qw( XrefParser::BaseParser )
;
sub
run_script
{
my
$self
=
shift
if
(
defined
(
caller
(
1
)));
my
$file
=
shift
;
my
$source_id
=
shift
;
my
$species_id
=
shift
;
my
$verbose
=
shift
;
my
$user
=
"
ensro
";
my
$host
;
my
$port
=
3306
;
my
$dbname
;
my
$pass
;
my
$tran_name
;
if
(
$file
=~
/host[=][>](\S+?)[,]/
){
$host
=
$
1
;
}
if
(
$file
=~
/port[=][>](\S+?)[,]/
){
$port
=
$
1
;
}
if
(
$file
=~
/dbname[=][>](\S+?)[,]/
){
$dbname
=
$
1
;
}
if
(
$file
=~
/pass[=][>](\S+?)[,]/
){
$pass
=
$
1
;
}
if
(
$file
=~
/tran_name[=][>](\S+?)[,]/
){
$tran_name
=
$
1
;
}
my
$add_dependent_xref_sth
=
$self
->
dbi
->
prepare
("
INSERT INTO dependent_xref (master_xref_id,dependent_xref_id, linkage_source_id) VALUES (?,?,
$source_id
)
");
my
$dbi2
=
$self
->
dbi2
(
$host
,
$port
,
$user
,
$dbname
,
$pass
);
if
(
!
defined
(
$dbi2
)){
return
1
;
}
my
(
%go
)
=
%
{
XrefParser::
BaseParser
->
get_valid_codes
("
GO
",
$species_id
)};
my
$count
=
0
;
my
$xref_sth
=
$dbi2
->
prepare
("
SELECT t.accession, s.name, s.accession FROM term t, term s, aux_GO_goslim_goa_map ts WHERE ts.term_id = t.term_id and ts.subset_term_id = s.term_id
");
$xref_sth
->
execute
()
or
croak
(
$dbi2
->
errstr
()
);
while
(
my
@row
=
$xref_sth
->
fetchrow_array
()
)
{
my
$term_acc
=
$row
[
0
];
my
$desc
=
$row
[
1
];
my
$subterm_acc
=
$row
[
2
];
if
(
defined
(
$go
{
$term_acc
})){
my
$xref_id
=
$self
->
add_xref
(
$subterm_acc
,
undef
,
$subterm_acc
,
$desc
,
$source_id
,
$species_id
,
"
DEPENDENT
");
$add_dependent_xref_sth
->
execute
(
$go
{
$term_acc
},
$xref_id
);
$count
++
;
}
}
$xref_sth
->
finish
;
print
"
Parsed GOSlim identifiers from
$file
, added
$count
dependent_xrefs
\n
"
if
(
$verbose
);
return
0
;
}
1
;
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment