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
1c8cce3a
Commit
1c8cce3a
authored
14 years ago
by
Karyn Megy
Browse files
Options
Downloads
Patches
Plain Diff
VectorBase PubMed parser
parent
d0949712
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/VBPubMedParser.pm
+87
-0
87 additions, 0 deletions
misc-scripts/xref_mapping/XrefParser/VBPubMedParser.pm
with
87 additions
and
0 deletions
misc-scripts/xref_mapping/XrefParser/VBPubMedParser.pm
0 → 100644
+
87
−
0
View file @
1c8cce3a
package
XrefParser::
VBPubMedParser
;
use
strict
;
use
POSIX
qw(strftime)
;
use
File::
Basename
;
use
base
qw( XrefParser::BaseParser )
;
# Parse the external description file
#
#PubMed ID Stable ID Feature Gene_ID (?) Origin
#1354853 AAEL009742 gene AAEL009742 Inferred from UniProt entry ABDA_AEDAE (P29552)
#1961751 AAEL006563 gene AAEL006563 Inferred from UniProt entry VCP_AEDAE (P42660)
#2052024 AAEL006424 gene AAEL006424 Inferred from UniProt entry ALL2_AEDAE (P18153)
if
(
!
defined
(
caller
()))
{
if
(
scalar
(
@ARGV
)
!=
1
)
{
print
STDERR
"
\n
Usage: VBPubMed.pm file <source_id> <species_id>
\n\n
";
exit
(
1
);
}
run
(
$ARGV
[
0
]);
}
sub
run
{
my
$self
=
shift
if
(
defined
(
caller
(
1
)));
my
$source_id
=
shift
;
my
$species_id
=
shift
;
my
$files
=
shift
;
my
$release_file
=
shift
;
my
$verbose
=
shift
;
my
$file
=
@
{
$files
}[
0
];
print
"
source_id =
$source_id
, species=
$species_id
, file =
$file
\n
"
if
(
$verbose
);
if
(
!
defined
(
$source_id
)){
$source_id
=
XrefParser::
BaseParser
->
get_source_id_for_filename
(
$file
);
}
if
(
!
defined
(
$species_id
)){
$species_id
=
XrefParser::
BaseParser
->
get_species_id_for_filename
(
$file
);
}
my
$added
=
0
;
my
$count
=
0
;
my
$file_io
=
$self
->
get_filehandle
(
$file
);
if
(
!
defined
$file_io
)
{
print
STDERR
"
ERROR: Could not open file
$file
\n
";
return
1
;
}
while
(
my
$line
=
$file_io
->
getline
()
)
{
if
(
$line
!~
/^#/
)
{
chomp
$line
;
my
(
$PubMed_id
,
$gene_id
,
$rien
,
$name
,
$origin
)
=
split
("
\t
",
$line
);
#and use the gene_id as accession
my
$descr_full
=
"
PubMed ID
$PubMed_id
-
$origin
\n
"
;
print
"
PMID:
$PubMed_id
, GID:
$gene_id
, NONE:
$rien
, NOM:
$name
, ORI:
$origin
\n
"
;
my
$xref_id
=
$self
->
get_xref
(
$gene_id
,
$source_id
,
$species_id
);
if
(
!
defined
(
$xref_id
)){
$xref_id
=
$self
->
add_xref
(
$gene_id
,"",
$gene_id
,
$descr_full
,
$source_id
,
$species_id
,
"
DIRECT
");
$count
++
;
}
if
(
defined
(
$gene_id
)
and
$gene_id
ne
"
-
"){
$self
->
add_direct_xref
(
$xref_id
,
$gene_id
,
"
Gene
",
"")
;
$added
++
;
}
}
$file_io
->
close
();
print
"
Added
$count
xrefs and
$added
Direct xrefs to genes for VBPubMed
\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