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
ceec6b24
Commit
ceec6b24
authored
12 years ago
by
Monika Komorowska
Browse files
Options
Downloads
Patches
Plain Diff
amended header_template value, description and printing of synonym counts
parent
7da24b27
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/MGI_Desc_Parser.pm
+18
-10
18 additions, 10 deletions
misc-scripts/xref_mapping/XrefParser/MGI_Desc_Parser.pm
with
18 additions
and
10 deletions
misc-scripts/xref_mapping/XrefParser/MGI_Desc_Parser.pm
+
18
−
10
View file @
ceec6b24
...
...
@@ -33,25 +33,32 @@ sub run {
}
my
$xref_count
=
0
;
my
$syn_count
=
0
;
my
%acc_to_xref
;
my
$header
=
$mgi_io
->
getline
();
#discard header line
chomp
(
$header
);
# crude emergency check for potentially altered file format.
my
$header_template
=
qq(MGI Accession ID\tChr\tcM Position\tgenome coordinate start\tgenome coordinate end\tstrand\tMarker Symbol\tStatus\tMarker Name\tMarker Type\tFeature Type\t
I
Marker Synonyms (pipe-separated))
;
my
$header_template
=
qq(MGI Accession ID\tChr\tcM Position\tgenome coordinate start\tgenome coordinate end\tstrand\tMarker Symbol\tStatus\tMarker Name\tMarker Type\tFeature Type\tMarker Synonyms (pipe-separated))
;
if
(
$header
ne
$header_template
)
{
die
"
File header has altered from format parser expects. Check MGI
"};
while
(
my
$line
=
$mgi_io
->
getline
()
)
{
chomp
(
$line
);
my
(
$accession
,
$chromosome
,
$position
,
$start
,
$end
,
$strand
,
$label
,
$status
,
$marker
,
$marker_type
,
$feature_type
,
$synonym_field
)
=
split
(
/\t
+
/
,
$line
);
$status
,
$marker
,
$marker_type
,
$feature_type
,
$synonym_field
)
=
split
(
/\t/
,
$line
);
$position
=~
s/^\s+//
;
my
@synonyms
=
split
(
/|/
,
$synonym_field
);
$position
=~
s/^\s+//
if
(
$position
);
my
@synonyms
=
split
(
/|/
,
$synonym_field
)
if
(
$synonym_field
);
my
$desc
=
join
("
",
$marker
,
$marker_type
);
my
$desc
;
if
(
$marker
)
{
$desc
=
$marker
;
}
$acc_to_xref
{
$accession
}
=
$self
->
add_xref
({
acc
=>
$accession
,
label
=>
$label
,
...
...
@@ -59,18 +66,18 @@ sub run {
source_id
=>
$source_id
,
species_id
=>
$species_id
,
info_type
=>
"
MISC
"}
);
if
(
$verbose
and
$desc
eq
""
){
if
(
$verbose
and
!
$desc
){
print
"
$accession
has no description
\n
";
}
$xref_count
++
;
if
(
defined
(
$acc_to_xref
{
$accession
})){
my
$syn_count
=
0
;
foreach
my
$syn
(
@synonyms
)
{
$self
->
add_synonym
(
$acc_to_xref
{
$accession
},
$syn
);
$syn_count
++
;
}
print
$syn_count
.
"
synonyms added
\n
"
if
(
$verbose
);
}
}
...
...
@@ -78,7 +85,8 @@ sub run {
$mgi_io
->
close
();
print
$xref_count
.
"
MGI Description Xrefs added
\n
"
if
(
$verbose
);
print
$syn_count
.
"
synonyms added
\n
"
if
(
$verbose
);
return
0
;
#successful
}
...
...
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