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
5311afe2
Commit
5311afe2
authored
14 years ago
by
Ian Longden
Browse files
Options
Downloads
Patches
Plain Diff
script to get data file.
parent
5df7a813
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/mouse_knockouts/IKMC_get_data.pl
+87
-0
87 additions, 0 deletions
misc-scripts/mouse_knockouts/IKMC_get_data.pl
with
87 additions
and
0 deletions
misc-scripts/mouse_knockouts/IKMC_get_data.pl
0 → 100644
+
87
−
0
View file @
5311afe2
#!/ebi/extserv/bin/perl/bin/perl
# an example script demonstrating the use of BioMart webservice
#
# NOTE this could have implemented in the parser itself but the data is needed
# for the simple features so
#
use
strict
;
use
LWP::
UserAgent
;
my
$xml
=
(
<<
XXML
);
<
?
xml
version
=
"
1.0
"
encoding
=
"
UTF-8
"?
>
<!
DOCTYPE
Query
>
<
Query
virtualSchemaName
=
"
default
"
formatter
=
"
TSV
"
header
=
"
0
"
uniqueRows
=
"
1
"
count
=
""
datasetConfigVersion
=
"
0.6
"
>
<
Dataset
name
=
"
dcc
"
interface
=
"
default
"
>
<
Attribute
name
=
"
mgi_accession_id
"
/>
<
Attribute
name
=
"
marker_symbol
"
/>
<
Attribute
name
=
"
vector_available
"
/>
<
Attribute
name
=
"
escell_available
"
/>
<
Attribute
name
=
"
mouse_available
"
/>
<
Attribute
name
=
"
ensembl_gene_id
"
/>
</
Dataset
>
</
Query
>
XXML
open
(
OUT
,"
>ensembl_ikmc_initial.txt
");
my
$path
=
"
http://www.i-dcc.org/biomart/martservice?
";
my
$request
=
HTTP::
Request
->
new
("
POST
",
$path
,
HTTP::
Headers
->
new
(),'
query=
'
.
$xml
.
"
\n
");
my
$ua
=
LWP::
UserAgent
->
new
;
my
$response
;
$ua
->
request
(
$request
,
sub
{
my
(
$data
,
$response
)
=
@_
;
if
(
$response
->
is_success
)
{
print
OUT
"
$data
";
}
else
{
warn
("
Problems with the web server:
"
.
$response
->
status_line
);
}
},
1000
);
close
OUT
;
my
%symbols
;
my
%ensembl_ids
;
my
%status
;
open
(
IN
,"
ensembl_ikmc_initial.txt
");
#nb [9] is now cell_line_bg and [10] is backcross
while
(
<
IN
>
){
my
@line
=
split
(
/\t/
,
$_
);
chop
$line
[
5
];
my
$mgi_id
=
$line
[
0
];
$symbols
{
$mgi_id
}
=
$line
[
1
];
$ensembl_ids
{
$mgi_id
}
=
$line
[
5
];
$status
{
$mgi_id
}
=
1
if
(
$status
{
$mgi_id
}
eq
'');
if
(
$status
{
$mgi_id
}
<
4
&&
$line
[
4
]
==
1
){
$status
{
$mgi_id
}
=
4
;
}
elsif
(
$status
{
$mgi_id
}
<
3
&&
$line
[
3
]
==
1
){
$status
{
$mgi_id
}
=
3
;
}
elsif
(
$status
{
$mgi_id
}
<
2
&&
$line
[
2
]
==
1
){
$status
{
$mgi_id
}
=
2
;
}
}
close
IN
;
open
(
OUT
,"
>ensembl_ikmc_xref.txt
");
foreach
my
$mgi_id
(
keys
%symbols
){
my
$description
;
$description
=
'
No products available yet
'
if
$status
{
$mgi_id
}
==
1
;
$description
=
'
Vector available
'
if
$status
{
$mgi_id
}
==
2
;
$description
=
'
ES cells available
'
if
$status
{
$mgi_id
}
==
3
;
$description
=
'
Mice available
'
if
$status
{
$mgi_id
}
==
4
;
print
OUT
"
$mgi_id
\t
$symbols
{
$mgi_id
}
\t
$description
\t
$ensembl_ids
{
$mgi_id
}
\n
";
}
close
OUT
;
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