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
cbb014a3
Commit
cbb014a3
authored
19 years ago
by
Glenn Proctor
Browse files
Options
Downloads
Patches
Plain Diff
Check-in before shutdown; draft parser for Gareth Wilson's Affy data. Very much a work in progress!
parent
8882e885
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
misc-scripts/xref_mapping/XrefParser/WilsonAffyParser.pm
+129
-0
129 additions, 0 deletions
misc-scripts/xref_mapping/XrefParser/WilsonAffyParser.pm
with
129 additions
and
0 deletions
misc-scripts/xref_mapping/XrefParser/WilsonAffyParser.pm
0 → 100644
+
129
−
0
View file @
cbb014a3
package
XrefParser::
WilsonAffyParser
;
use
strict
;
use
XrefParser::
BaseParser
;
use
vars
qw(@ISA)
;
@ISA
=
qw(XrefParser::BaseParser)
;
my
$xref_sth
;
my
$dep_sth
;
my
$syn_sth
;
sub
run
{
my
(
$self
,
$file
,
$source_id
,
$species_id
)
=
@_
;
my
@xrefs
=
$self
->
create_xrefs
(
$source_id
,
$species_id
,
$file
);
# upload
XrefParser::
BaseParser
->
upload_xref_object_graphs
(
@xrefs
);
}
sub
create_xrefs
{
my
(
$self
,
$source_id
,
$species_id
,
$file
)
=
@_
;
my
(
$count
,
$noseq
,
$direct
)
=
(
0
,
0
,
0
);
$|
=
1
;
# don't buffer
my
@xrefs
;
open
(
FILE
,"
<
"
.
$file
)
||
die
"
Could not open
$file
\n
";
<
FILE
>
;
# skip first line
while
(
<
FILE
>
)
{
#last if ($count > 200);
my
$xref
;
my
@fields
=
split
/\t/
;
# first field (probe_set) is accession
my
$acc
=
$fields
[
0
];
chomp
(
$acc
);
$acc
=~
s/\"//g
;
# get linked accession (may be RefSeq or EMBL or ensembl)
my
$target
=
$fields
[
2
];
chomp
(
$target
);
$target
=~
s/\"//g
;
# Create direct xrefs for mappings to Ensembl transcripts
if
(
$target
=~
/ENSGALT/
)
{
# remove version if present
(
$target
)
=
$target
=~
/([^.]*)\.([^.]*)/
;
# add xref - not we're assuming it doesn't already exist;
# may need to check like in CCDS parser
my
$xref_id
=
$self
->
add_xref
(
$acc
,
0
,
$acc
,
"",
$source_id
,
$species_id
);
$self
->
add_direct_xref
(
$xref_id
,
$target
,
"
transcript
",
"");
$direct
++
;
}
else
{
# fetch sequence for others (EMBL ESTs and RefSeqs - pfetch will handle these)
system
("
pfetch -q
$target
> seq.txt
");
open
(
SEQ
,
"
<seq.txt
");
my
$seq
=
<
SEQ
>
;
chomp
(
$seq
);
close
(
SEQ
);
if
(
$seq
&&
$seq
!~
/no match/
)
{
$xref
->
{
ACCESSION
}
=
$acc
;
$xref
->
{
SEQUENCE
}
=
$seq
;
$xref
->
{
LABEL
}
=
$acc
;
$xref
->
{
SOURCE_ID
}
=
$source_id
;
$xref
->
{
SPECIES_ID
}
=
$species_id
;
$xref
->
{
SEQUENCE_TYPE
}
=
'
dna
';
$xref
->
{
STATUS
}
=
'
experimental
';
# Add description noting where the mapping came from
$xref
->
{
DESCRIPTION
}
=
$target
.
"
used as mapping target
";
#print $xref->{ACCESSION} . " " . $target . " " . $? . "\n";
$count
++
;
print
"
$count
"
if
(
$count
%
100
==
0
);
push
@xrefs
,
$xref
;
}
else
{
print
"
Couldn't get sequence for
$target
\n
";
$noseq
++
;
}
}
}
close
(
FILE
);
print
"
\n\n
Parsed
$count
primary xrefs.
\n
";
print
"
Couldn't get sequence for
$noseq
primary_xrefs
\n
"
if
(
$noseq
);
print
"
Added
$direct
direct xrefs.
\n
";
return
\
@xrefs
;
}
sub
new
{
my
$self
=
{};
bless
$self
,
"
XrefParser::WilsonAffyParser
";
return
$self
;
}
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