AlexsLemonade / scpca-portal

Single-cell Pediatric Cancer Atlas Portal is a growing database of uniformly processed single-cell data from pediatric cancer tumors and model systems
https://scpca.alexslemonade.org
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

Add citation information in download README #451

Closed dvenprasad closed 12 months ago

dvenprasad commented 1 year ago

Context

We are adding a citation for the portal. Documentation ticket: https://github.com/AlexsLemonade/scpca-docs/issues/155

Problem or idea

Add the citation to the portal under Citation Section. Populate the Accessed download date dynamically to the date the dataset was downloaded.

Also add a link to the section is the docs explaining how to cite for projects without publications or pre-prints.

Solution or next step

The science team to provide copy for the above items.

davidsmejia commented 1 year ago

Next Steps:

Prepend “Generation Date: YYYY-MM-DD” to Readme

https://github.com/AlexsLemonade/scpca-portal/blob/dev/api/scpca_portal/models/computed_file.py#L128

We need to open the appropriate README and prepend "Generated On: YYYY-MM-DD" to the file before writing it to the zipfile. This should happen for each class method that generates a computed file zip.

Dynamic filenames to include download date

We need to update the generated link to update the downloaded filename at time of download.

https://github.com/AlexsLemonade/scpca-portal/blob/dev/api/scpca_portal/models/computed_file.py#L329


   def create_download_url(self):
        """Creates a temporary URL from which the file can be downloaded."""
        if self.s3_bucket and self.s3_key:
            date = datetime.today().strfrmtime("%Y-%M-%d")
            filename  = f"{date}_{self.s3_key}"
            return s3.generate_presigned_url(
                ClientMethod="get_object",
                Params={
                  "Bucket": self.s3_bucket,
                  "Key": self.s3_key,
                  "ResponseContentDisposition": f"attachment; filename = {filename}"
                },
                ExpiresIn=(60 * 60 * 24 * 7),  # 7 days in seconds.
            )
davidsmejia commented 1 year ago

@dvenprasad we can "templatize" the how to cite section instead of just prepending the "Generated On: 2023-10-26" to the readme's. We can also do project vs sample specific citation information.

jaclyn-taroni commented 1 year ago

Just noting that we're not going to do https://github.com/AlexsLemonade/scpca-portal/issues/451#issuecomment-1781781480, because that would capture the generation date not the access date. The access date is what we want for citations per the styles we'll suggest.