Repository: AlexsLemonade/refinebio

Issue:
Same platforms showing up as different in metadata due to spacing inconsistencies
### Context
Related to [Front end issue 602](https://github.com/AlexsLemonade/refinebio-frontend/issues/602)
Found that this problem of spacing inconsistencies is in the metadata and [API entries](https://api.refine.bio/experiments/?accession_code=SRP068467) as well 

### Problem or idea

Differences in spacings are making the same platform show up as different platforms. 
See example [SRP068467](https://api.refine.bio/experiments/?accession_code=SRP068467)
Note how all the samples are IlluminaHiSeq2000 but it is sometimes noted as `Illumina HiSeq 2000` or sometimes `IlluminaHiSeq2000`

### Solution or next step

@kurtwheeler and @Miserlou to find out source of inconsistent spacings

### New Issue Checklist

- [x] The title is short and descriptive.
- [x] You have explained the context that led you to write this issue.
- [x] You have reported a problem or idea.
- [ ] You have proposed a solution or next step.



Discussion:
Noticed this in the smasher too: https://api.refine.bio/dataset/ed809857-22b5-457d-83ef-379ebfc6b4d8/
This issue is because the migration we made here: https://github.com/AlexsLemonade/refinebio/blob/dev/common/data_refinery_common/migrations/0017_auto_20190312_2011.py was only for the Samples model and excluded the experiments model. We just need to make a new migration which does almost the same exact thing except for the `platform_names` field of the experiments model.
For `Experiments`, the `platform_names` field contains a list of the platform names for each sample associated with the experiment.

Seems that there are some samples where the platform name is also incorrect, for example [SRR3101945](https://api.refine.bio/samples/?accession_code=SRR3101945&limit=10&offset=0). This sample was created on `2018-12-09`, while the [PR with the migration](https://github.com/AlexsLemonade/refinebio/pull/783) was [deployed](https://github.com/AlexsLemonade/refinebio/pull/1126) after the sample was created (on `2018-03-14`).

My guess is that the migration in #783 to correct the samples was not applied correctly. 
we need to re-create the migration here

Resolving patch:
diff --git a/common/data_refinery_common/migrations/0023_fix_platform_names_spaces.py b/common/data_refinery_common/migrations/0023_fix_platform_names_spaces.py
new file mode 100644
--- /dev/null
+++ b/common/data_refinery_common/migrations/0023_fix_platform_names_spaces.py
@@ -0,0 +1,22 @@
+
+from django.db import migrations
+from data_refinery_common.utils import get_supported_rnaseq_platforms
+from django.core.paginator import Paginator
+
+def make_sample_platform_names_readable(apps, schema_editor):
+    Sample = apps.get_model('data_refinery_common', 'Sample')
+
+    for platform_name in get_supported_rnaseq_platforms():
+        munged_platform = platform_name.replace(' ', '')
+        Sample.objects.all().filter(platform_name=munged_platform).update(platform_name=platform_name)
+        print("Updating platform name from \'%s\' to \'%s\'" % (munged_platform, platform_name))
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('data_refinery_common', '0022_auto_20190607_1505'),
+    ]
+
+    operations = [
+        migrations.RunPython(make_sample_platform_names_readable)
+    ]


Test patch: