Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MCQR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
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
PAPPSO
MCQR
Commits
e2ae219a
Commit
e2ae219a
authored
3 years ago
by
thierry balliau
Browse files
Options
Downloads
Patches
Plain Diff
creation fonction mcq.write
aide a faire
parent
470781ae
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
MCQR/DESCRIPTION
+1
-1
1 addition, 1 deletion
MCQR/DESCRIPTION
MCQR/NAMESPACE
+1
-0
1 addition, 0 deletions
MCQR/NAMESPACE
MCQR/R/mcq_write.R
+61
-0
61 additions, 0 deletions
MCQR/R/mcq_write.R
with
63 additions
and
1 deletion
MCQR/DESCRIPTION
+
1
−
1
View file @
e2ae219a
...
...
@@ -2,7 +2,7 @@ Package: MCQR
Type: Package
Title: a R Package for Analysis of Mass-Spectrometry-Based Proteomics Data
Version: 0.5.2
Date: 2021-0
8-31
Date: 2021-0
9-06
Author: PAPPSO team (pappso-projetsbioinfo@groupes.renater.fr)
Maintainer: PAPPSO team <pappso-projetsbioinfo@groupes.renater.fr>
Description: R package dedicated to the statistical analysis of mass-spectrometry-based proteomic data.
...
...
This diff is collapsed.
Click to expand it.
MCQR/NAMESPACE
+
1
−
0
View file @
e2ae219a
...
...
@@ -139,6 +139,7 @@
export("mcq.write.merge")
export("mcq.write.metadata.template")
export("mcq.write.synthesis")
export("mcq.write")
# Other Functions
...
...
This diff is collapsed.
Click to expand it.
MCQR/R/mcq_write.R
0 → 100644
+
61
−
0
View file @
e2ae219a
#### Fonction pour effectuer toute les operation d'ecriture de fichier de resultat pour mcqr
### peut prendre en entrée des dataframes uniquement (en empilé ou depilé)
### permet d'exporter en ods ou en tsv au choix
### pour le format tsv on doit ajouter le separateur de decimal et de colonne
### vu que le fichier peut etre en csv ou en ods ne pas mettre d'extension dans le nom du fichier (ou bien le supprimer si existant )
### extension en fonction du format et des séparateur
mcq.write
<-
function
(
object
,
type
=
"text"
,
sep
=
"\t"
,
dec
=
"."
,
file
=
"export"
){
### check argument
error_messages
=
list
()
j
=
1
if
(
!
is.character
(
type
)
||
!
(
type
%in%
c
(
"flat"
,
"ods"
))){
error_messages
[[
j
]]
=
"The 'type' argument must be 'flat' or 'ods'."
j
=
j
+1
}
if
(
!
is.character
(
sep
)
&&
!
(
type
%in%
c
(
"\t"
,
","
,
";"
))){
error_messages
[[
j
]]
=
"The 'sep' argument must be '\t', ',' or ';'."
j
=
j
+1
}
if
(
!
is.character
(
dec
)
&&
!
(
type
%in%
c
(
"\\."
,
","
))){
error_messages
[[
j
]]
=
"The 'sep' argument must be ',' or '.'."
j
=
j
+1
}
if
(
!
is.character
(
file
)){
error_messages
[[
j
]]
=
"The 'file' argument must be characters."
j
=
j
+1
}
if
(
str_count
(
file
,
"\\."
)
!=
0
){
error_messages
[[
j
]]
=
"Please do not specify extension for file argument. It will be automatically add."
j
=
j
+1
}
if
(
sep
==
dec
){
error_messages
[[
j
]]
=
"It is not possible to have the same argument for the sep argument and the dec argument."
j
=
j
+1
}
if
(
!
(
"data.frame"
%in%
class
(
object
))){
error_messages
[[
j
]]
=
"the object must be a data.frame."
j
=
j
+1
}
if
(
length
(
error_messages
)
!=
0
){
stop
(
paste
(
"Error on argument format:\n"
,
paste
(
error_messages
,
collapse
=
"\n"
),
sep
=
""
))
}
if
(
type
==
"ods"
){
filename
=
paste0
(
file
,
".ods"
)
write_ods
(
object
,
filename
,
sheet
=
"Sheet1"
)
}
else
if
(
type
==
"flat"
){
if
(
sep
==
"\t"
){
filename
=
paste0
(
file
,
".tsv"
)
}
else
{
filename
=
paste0
(
file
,
".csv"
)
}
write.table
(
object
,
file
=
filename
,
sep
=
sep
,
dec
=
dec
,
row.names
=
F
)
}
}
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