Skip to content

Commit

Permalink
Merge pull request #158 from 4dn-dcic/use_openpyxl
Browse files Browse the repository at this point in the history
Use openpyxl
  • Loading branch information
aschroed committed May 3, 2022
2 parents c7a3f81 + d91d330 commit 1455635
Show file tree
Hide file tree
Showing 89 changed files with 438 additions and 465 deletions.
Binary file removed Data_Files/MicroscopyCalibration/1calibration.xls
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/Protocols/DilutionHiC.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/Protocols/InsituHiC.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/RaoRepSetDiff.xlsx
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/del_test.xlsx
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/fieldsJinSelvaraj.xls
Binary file not shown.
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/fieldsRao.xls
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/fieldsRaoRelease.xls
Binary file not shown.
Binary file removed Data_Files/Rao_et_al_2014/testing_images.xlsx
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_F121-9_SOP_170314.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_H1_SOP_170305.pdf
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_HAP1_SOP_170314.pdf
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_HEK293_SOP_170314.pdf
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_HFFc6_SOP_161216.pdf
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_IMR90_SOP_161101.pdf
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_K562_SOP_170314.pdf
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_U2OS_SOP_170314.pdf
Binary file not shown.
Binary file removed Data_Files/SOPs/Documents/4DN_WTC-11_SOP_150309.pdf
Binary file not shown.
Binary file not shown.
Binary file removed Data_Files/SOPs/cell_lines_and_SOPs_170522.xls
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Data_Files/Submission Pack/Example_rao_etal2014.xls
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 0 additions & 7 deletions Data_Files/Submission Pack/keypairs.json

This file was deleted.

9 changes: 0 additions & 9 deletions Data_Files/reference_files/file_reference.json

This file was deleted.

9 changes: 0 additions & 9 deletions Data_Files/reference_files/file_reference2.json

This file was deleted.

34 changes: 0 additions & 34 deletions Data_Files/workflow_mapping/workflow_mapping_combined.json

This file was deleted.

30 changes: 0 additions & 30 deletions Data_Files/workflows/combine_workflow.json

This file was deleted.

7 changes: 0 additions & 7 deletions Data_Files/workflows/workflow.json

This file was deleted.

7 changes: 0 additions & 7 deletions Data_Files/workflows/workflow2.json

This file was deleted.

7 changes: 0 additions & 7 deletions Data_Files/workflows/workflow3.json

This file was deleted.

7 changes: 0 additions & 7 deletions Data_Files/workflows/workflow4.json

This file was deleted.

29 changes: 12 additions & 17 deletions README.md
Expand Up @@ -58,7 +58,7 @@ If you do not yet have access, please contact [4DN Data Wranglers](mailto:suppor
to get an account and [learn how to generate and save a key](https://data.4dnucleome.org/help/submitter-guide/getting-started-with-submissions#getting-connection-keys-for-the-4dn-dcic-servers).

## Generating data submission forms
To create the data submission xls forms, you can use `get_field_info`.
To create the data submission excel workbook, you can use `get_field_info`.

It will accept the following parameters:
~~~~
Expand All @@ -68,7 +68,7 @@ It will accept the following parameters:
--nodesc do not add the descriptions in the second line (by default they are added)
--noenums do not add the list of options for a field if they are specified (by default they are added)
--comments adds any (usually internal) comments together with enums (by default False)
--outfile change the default file name "fields.xls" to a specified one
--outfile change the default file name "fields.xlsx" to a specified one
--debug to add more debugging output
--noadmin if you have admin access to 4DN this option lets you generate the sheet as a non-admin user
~~~~
Expand All @@ -77,19 +77,19 @@ Examples generating a single sheet:
~~~~
get_field_info --type Biosample
get_field_info --type Biosample --comments
get_field_info --type Biosample --comments --outfile biosample.xls
get_field_info --type Biosample --comments --outfile biosample.xlsx
~~~~

Example Workbook with all sheets:
~~~~
get_field_info --outfile MetadataSheets.xls
get_field_info --outfile MetadataSheets.xlsx
~~~~

Examples for Workbooks using a preset option:
~~~~
get_field_info --type HiC --comments --outfile exp_hic_generic.xls
get_field_info --type ChIP-seq --comments --outfile exp_chipseq_generic.xls
get_field_info --type FISH --comments --outfile exp_fish_generic.xls
get_field_info --type HiC --comments --outfile exp_hic_generic.xlsx
get_field_info --type ChIP-seq --comments --outfile exp_chipseq_generic.xlsx
get_field_info --type FISH --comments --outfile exp_fish_generic.xlsx
~~~~

Current presets include: `Hi-C, ChIP-seq, Repli-seq, ATAC-seq, DamID, ChIA-PET, Capture-C, FISH, SPT`
Expand All @@ -100,15 +100,15 @@ Please refer to the [submission guidelines](https://data.4dnucleome.org/help/sub

After you fill out the data submission forms, you can use `import_data` to submit the metadata. The method can be used both to create new metadata items and to patch fields of existing items.
~~~~
import_data filename.xls
import_data filename.xlsx
~~~~

#### Uploading vs Patching

Runnning `import_data` without one of the flags described below will perform a dry run submission that will include several validation checks.
It is strongly recommended to do a dry run prior to actual submission and if necessary work with a Data Wrangler to correct any errors.

If there are uuid, alias, @id, or accession fields in the xls form that match existing entries in the database, you will be asked if you want to PATCH each object.
If there are uuid, alias, @id, or accession fields in the excel form that match existing entries in the database, you will be asked if you want to PATCH each object.
You can use the `--patchall` flag, if you want to patch ALL objects in your document and ignore that message.

If no object identifiers are found in the document, you need to use `--update` for POSTing to occur.
Expand All @@ -131,7 +131,7 @@ Note if you are attempting to run the scripts in the wranglertools directory wit

```
python -m wranglertools.get_field_info —-type Biosource
python -m wranglertools.import_data filename.xls
python -m wranglertools.import_data filename.xlsx
```

pypi page is - https://pypi.python.org/pypi/Submit4DN
Expand All @@ -158,10 +158,5 @@ To run the mark tests, or exclude them from the tests you can use the following
# Run only tests with file_operation
py.test -m file_operation

For a better testing experienece that also check to ensure sufficient coverage and runs linters use invoke:

```
invoke test
```

This will first run linters, if linters pass, tests will be run and if tests achieve specified minimum coverage (89% as of time of writting) pass the tests.
# skip tests that use ftp (do this when testing locally)
py.test -m "not ftp"

0 comments on commit 1455635

Please sign in to comment.