Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cc-qtl/cc-qtl-db
1 result
Show changes
Commits on Source (4)
......@@ -161,11 +161,11 @@
<td>CC001</td>
</tr>
<tr>
<td>1</td>
<td>3</td>
<td>CC002</td>
</tr>
<tr>
<td>2</td>
<td>4</td>
<td>CC002</td>
</tr>
<tr>
......
......@@ -24,7 +24,7 @@ export default {
title: { text: 'SNPs association' },
yAxis: {
title: {
text: 'LOD',
text: '- Log(p-value)',
},
},
xAxis: {
......
......@@ -310,7 +310,12 @@ export default {
)
this.$fetch()
} catch (err) {
this.error = err.message
console.dir(err)
if (err?.response?.data && err.response.data.length > 0) {
this.error = err.response.data[0]
} else {
this.error = err.message
}
} finally {
this.closeDelete()
}
......
......@@ -2,6 +2,7 @@
<v-card flat color="transparent" class="mt-3">
<v-card>
<error-alert v-if="error" :error-message="error"></error-alert>
<Peaks
v-if="sanitizedPeaks.length > 0"
:title="titleList"
......@@ -11,11 +12,19 @@
:headers="headers"
:selected-item="selectedItem"
/>
<v-card-actions
><download-csv :data="exportPeak" :name="exportFileName">
<v-btn class="mx-2" color="secondary" small fab>
<v-icon>mdi-table-arrow-down</v-icon>
</v-btn>
</download-csv></v-card-actions
>
</v-card>
<nuxt-child />
</v-card>
</template>
<script>
import JsonCSV from 'vue-json-csv'
import ErrorAlert from '@/components/ErrorAlert'
import Peaks from '~/components/DataTableActions.vue'
......@@ -23,6 +32,7 @@ export default {
components: {
Peaks,
ErrorAlert,
downloadCsv: JsonCSV,
},
async asyncData({ $axios, params, $auth, route }) {
......@@ -56,11 +66,11 @@ export default {
titleList: 'Significant peaks',
headers: [
{ text: 'Id', align: 'start', value: 'id' },
// {
// text: 'Variable Name',
{
text: 'Variable Name',
// value: 'name',
// },
value: 'name',
},
{ text: 'Chromosome', value: 'chromosome' },
{ text: 'Position', value: 'position' },
{ text: 'Lod Score', value: 'lod' },
......@@ -78,9 +88,25 @@ export default {
itemRoute: this.getItemRoute(peak),
}))
},
exportPeak() {
return this.peaks.map(
// eslint-disable-next-line camelcase
({ ci_hi, ci_lo, lod, p_value, position, variable_name }) => ({
ci_hi,
ci_lo,
lod,
p_value,
position,
variable_name,
})
)
},
selectedItem() {
return parseInt(this.$route.params?.peakId)
},
exportFileName() {
return `${this.projectId}-${this.analysisId}-significant-peaks.csv`
},
},
methods: {
getItemRoute({ id: peakId }) {
......
......@@ -173,7 +173,7 @@
</v-card-text>
<v-toolbar flat>
<v-toolbar-title
>pig dingy for a generic reminder
>generic reminder : pig shape transformation
</v-toolbar-title></v-toolbar
>
......
......@@ -9,6 +9,7 @@ from django.http.request import QueryDict
from django.shortcuts import get_object_or_404
from django.http import JsonResponse
from django.db import transaction, DataError
from django.db.models import ProtectedError
from django.db.utils import IntegrityError
......@@ -541,6 +542,15 @@ class PhenotypeCategoryViewSet(viewsets.ModelViewSet):
serializer_class = PhenotypeCategorySerializer
permission_classes = [CustomPermissions]
def perform_destroy(self, instance):
try:
instance.delete()
except ProtectedError as e:
print(e)
raise serializers.ValidationError(
f"The phenotype category {instance.name} is apply on phenotypes. You cannot delete it !!"
)
@action(detail=False)
def permissions(self, request, pk=None):
current_user = request.user
......