Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp1ARA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OTT Oceane
tp1ARA
Commits
522ff6e1
Commit
522ff6e1
authored
6 months ago
by
OTT Oceane
Browse files
Options
Downloads
Patches
Plain Diff
mod
parent
08c57764
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/tp1.R
+25
-19
25 additions, 19 deletions
src/tp1.R
workflows/Makefile
+0
-21
0 additions, 21 deletions
workflows/Makefile
workflows/makefile
+1
-0
1 addition, 0 deletions
workflows/makefile
with
26 additions
and
40 deletions
src/tp1.R
+
25
−
19
View file @
522ff6e1
wdir
=
"."
dir.create
(
wdir
,
showWarnings
=
F
,
recursive
=
T
)
setwd
(
wdir
)
#library(devtools)
#library(plyr)
if
(
!
require
(
"BiocManager"
,
quietly
=
TRUE
))
install.packages
(
"BiocManager"
)
if
(
!
require
(
"snpStats"
,
quietly
=
TRUE
))
BiocManager
::
install
(
"snpStats"
)
if
(
!
require
(
"SNPRelate"
,
quietly
=
TRUE
))
BiocManager
::
install
(
"SNPRelate"
)
# Charger les bibliothèques
library
(
snpStats
)
library
(
SNPRelate
)
options
(
repos
=
c
(
CRAN
=
"https://cloud.r-project.org"
))
output_dir
=
"results/tp1"
dir.create
(
output_dir
,
showWarnings
=
F
,
recursive
=
T
)
# Les données analysées nécessitant beaucoup de RAM, nous allons sélectionner aléatoirement 250000 SNPs et réecrire des fichiers bed, bim, fam
penncath_bed_path
=
"results/data/penncath.bed"
penncath_bim_path
=
"results/data/penncath.bim"
penncath_fam_path
=
"results/data/penncath.fam"
geno
<-
snpStats
::
read.plink
(
penncath_bed_path
,
penncath_bim_path
,
penncath_fam_path
,
select.snps
=
sample
(
1
:
861473
,
25000
,
replace
=
FALSE
),
na.strings
=
(
"-9"
))
plink_base
=
file.path
(
output_dir
,
"plink_base"
)
snpStats
::
write.plink
(
plink_base
,
snps
=
geno
$
genotypes
,
pedigree
=
geno
$
fam
[,
1
],
id
=
geno
$
fam
[,
1
],
mother
=
geno
$
fam
[,
4
],
sex
=
geno
$
fam
[,
5
],
phenotype
=
geno
$
fam
[,
6
],
chromosome
=
geno
$
map
[,
1
],
genetic.distance
=
geno
$
map
[,
3
],
position
=
geno
$
map
[,
4
],
allele.1
=
geno
$
map
[,
5
],
allele.2
=
geno
$
map
[,
6
],
na.code
=
(
"-9"
))
genoBim
<-
geno
$
map
colnames
(
genoBim
)
<-
c
(
"chr"
,
"SNP"
,
"gen.dist"
,
"position"
,
"A1"
,
"A2"
)
#head(genoBim)
genotype
<-
geno
$
genotype
#print(genotype)
genoFam
<-
geno
$
fam
#head(genoFam)
# On commence par libérer de l'espace
rm
(
geno
)
rdata_path
=
file.path
(
output_dir
,
"TP1_asbvg.RData"
)
save.image
(
rdata_path
)
This diff is collapsed.
Click to expand it.
workflows/Makefile
deleted
100644 → 0
+
0
−
21
View file @
08c57764
# Makefile pour enchaîner deux scripts
# Cible par défaut (si 'make' est appelé sans argument)
all
:
tp1_output.txt
# Première étape : exécuter download_data.R
download_data_output.txt
:
~/tp1ara/src/download_data.R
@
echo
"Running download_data.R..."
@
Rscript ~/tp1ara/src/download_data.R
>
download_data_output.txt
@
echo
"download_data.R completed and output stored in download_data_output.txt."
# Deuxième étape : exécuter tp1.R en utilisant le résultat du premier script
tp1_output.txt
:
download_data_output.txt ~/tp1ara/src/tp1.R
@
echo
"Running tp1.R..."
@
Rscript ~/tp1ara/src/tp1.R
>
tp1_output.txt
@
echo
"tp1.R completed and output stored in tp1_output.txt."
# Nettoyer les fichiers générés
clean
:
@
rm
-f
download_data_output.txt tp1_output.txt
@
echo
"Cleaned up output files."
This diff is collapsed.
Click to expand it.
workflows/makefile
.v2
→
workflows/makefile
+
1
−
0
View file @
522ff6e1
...
...
@@ -18,3 +18,4 @@ results/data/penncath.bed results/data/penncath.bim results/data/penncath.fam:
clean
:
rm
-rf
results/data/penncath.bed results/data/penncath.bim results/data/penncath.fam results/data/penncath.csv results/penncath.tar.gz results/data
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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